Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running dashboard on another server? #35

Open
iamcam opened this issue Oct 4, 2011 · 11 comments
Open

Running dashboard on another server? #35

iamcam opened this issue Oct 4, 2011 · 11 comments

Comments

@iamcam
Copy link

iamcam commented Oct 4, 2011

Sorry - brand new to node, so please bare with me. I'm a bit confused by the instruction on getting the dashboard to run on a different server. Should the remote location also be running node server.js, or can we just stick it on an Apache/other server? Running it locally (IE localhost:80) loads, however the socket doesn't seem to start (the every-two second tracking lines don't even animate).

Any clarification would be much appreciated. Thanks!

@mnutt
Copy link
Owner

mnutt commented Nov 14, 2011

You should be able to just use apache or nginx with the public/ directory as its root. Just be sure to change index.html to make all references to localhost:8000 point to where you're running the node app.

@mnutt
Copy link
Owner

mnutt commented Nov 14, 2011

And actually, now that I think about it, websockets works cross-domain but I'm not sure that all transports provided by socket.io do.

One thing that helps is to open up firebug or the webkit inspector and see if there are any errors listed. If not, check out hummingbirdSocket.socket to see what transport socket.io is trying to use.

@iamcam
Copy link
Author

iamcam commented Nov 14, 2011

Thanks. I'll definitely look a bit closer next time I fire up a new service. I don't recall seeing any inspector errors, but I also didn't have a lot of time to debug what was going on.

@richardbenson
Copy link

There's a couple of really obvious changes, the one I always forget to make it line 64 of websocket.js, change to var wsServer = "your.hostname.com";

In your Index.html:
<script src="http://your.hostname.com/socket.io/socket.io.js"></script>
<script>WEB_SOCKET_SWF_LOCATION = 'http://your.hostname.com/socket.io/WebSocketMain.swf';</script>

Remember to add relevant ports if you use them. You may need to set your config.js to support this as well, including disabling the local dashboard if you want your tracking pixel on port 80.

@ghost
Copy link

ghost commented May 17, 2012

Perhaps in a future version, the JS and CSS paths can be changed to relative paths ("js/helpers.js" instead of "/js/helpers.js") to ensure compatibility with dashboards in subdirectories/aliases of other webserver's virtual hosts.

Also HTTPS compatibility for the map would be appreciated, but first Cloudmade should fix their SSL certificates.

Edit: I had to copy the socket.io JS and SWF files from somewhere else on my system to the public directory. Maybe these files could be included in the public directory by default, or some documentation could be added about these files.

@mnutt
Copy link
Owner

mnutt commented Oct 5, 2012

Hopefully a0891ca should help some with running the dashboard in a subdirectory of another webserver.

I've replaced the Cloudmade maps with some custom maps I've made in Tilemill. The tile URLs are protocol-less and should work on https. If you want to customize the maps, it's pretty easy to generate your own Tilemill maps, extract with mbtile, and upload them to S3.

I'm a bit undecided on including the socket.io js in public/. It would make things more convenient long-term, but if the client/server socket.io versions don't stay in sync it can lead to some weird bugs. I'll add some documentation for running the dashboard on another server.

@wpoosanguansit
Copy link

Hi,

I came across the post and wonder if there is already documentation on running hummingbird in another server? I am trying to run hummingbird in Apache2 but I am still unable to get things running correctly.

Firstly, I do not see var wsServer = "your.hostname.com"; in websocket.js as mentioned. And also, the console keeps showing dashbord is listening even when I disable it in the config.js. And finally, the reference to

<script src="http://your.hostname.com/socket.io/socket.io.js"></script> <script>WEB_SOCKET_SWF_LOCATION = 'http://your.hostname.com/socket.io/WebSocketMain.swf';</script>

in index.html seem to not find the resource when I point it to the server name and port that node server.js is running at. I appreciate any help. Thank you.

@mnutt
Copy link
Owner

mnutt commented Mar 26, 2013

I'm really sorry, unfortunately Hummingbird dashboard can't run behind Apache because Apache doesn't support websockets. It can run behind nginx, but only one of the very latest releases. Another option would be putting it behind something like Doorman:

https://github.com/movableink/doorman

I know this is a pain point for a lot of people so in the next version I plan on adding authentication into Hummingbird itself so that it doesn't have to run behind another webserver.

@wpoosanguansit
Copy link

Thank you. That would be great. Also, would there be any documentation in how to use Hummingbird? I followed what is on github but I still could not see anything being tracked. I know I must be doing something not right but I just have no clue what would be. Again thank you for you help.

On Mar 26, 2013, at 12:12 AM, Michael Nutt notifications@github.com wrote:

I'm really sorry, unfortunately Hummingbird dashboard can't run behind Apache because Apache doesn't support websockets. It can run behind nginx, but only one of the very latest releases. Another option would be putting it behind something like Doorman:

https://github.com/movableink/doorman

I know this is a pain point for a lot of people so in the next version I plan on adding authentication into Hummingbird itself so that it doesn't have to run behind another webserver.


Reply to this email directly or view it on GitHub.

@mnutt
Copy link
Owner

mnutt commented Mar 27, 2013

Check out this screencast for a demo on setting up hummingbird to work with a wordpress blog: https://vimeo.com/56302832

@wpoosanguansit
Copy link

Thank you Michael. I have followed the step until the send test traffic, which does not show the signal like in the screencast. And here is the print out on the console.

➜ hummingbird git:(master) ✗ node server.js
info - socket.io started
Loaded metric view_totals
Loaded metric hits
Loaded metric cart_adds
Dashboard listening on http://:8080.
Tracker listening on http://
:8000/tracking_pixel.gif.
server listening 0.0.0.0:8000
Loaded metric locations

  • /
  • /css/main.css
  • /css/map.css
  • /js/jquery-1.7.min.js
  • /css/weekly.css
  • /js/websocket.js
  • /js/helpers.js
  • /js/polymaps-extras.js
  • /js/polymaps.js
  • /js/d3.v2.js
  • /js/widgets/base.js
  • /js/widgets/graph.js
  • /js/widgets/logger.js
  • /js/widgets/map.js
  • /js/widgets/count.js
  • /images/header-bg.png
  • /fonts/TitilliumText800wt.woff
  • /tracking_pixel.gif?_=0.1974564828216484
  • /tracking_pixel.gif?_=0.7434306447563814
  • /tracking_pixel.gif?_=0.124833741749234
  • /tracking_pixel.gif?_=0.47203669488991506
  • /tracking_pixel.gif?_=0.5408193920845795
    1 users connected.

Would there be anything else that was changed and needed extra steps to be taken? Or is there any way to debug what is not working right in my environment? Thanks again for your help.

On Mar 26, 2013, at 11:26 PM, Michael Nutt notifications@github.com wrote:

Check out this screencast for a demo on setting up hummingbird to work with a wordpress blog: https://vimeo.com/56302832


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants