Node.js listening to port 80 (VPS)


#1

Is it possible to run a node.js server listening to port 80? I have a dreamhost VPS account.

Supposedly they run Apache, which already binds port 80. So we can’t?


#2

Update: I submitted a support ticket. The reply was to bind to 8080 and setup a proxy. That means I would have to run Apache in front of node.js?!

Time to look for another host? -__-’’’


#3

Running node.js behind some sort of reverse proxy (such as Apache or nginx) is generally considered best practices. I’d strongly advise you to try setting it up that way first.

If you really want to run node.js without anything in front of it, you can disable Apache in the “Configure Server” section of the panel (by changing the web server to “no web server”), which will disable Apache and allow you to run your own server bound to port 80. Keep in mind, however, that this will cause all web sites currently hosted on your VPS to become unavailable, and that you will need to run the node.js server as root to bind to port 80.