Configuring Ubuntu Server so Node.Js app (port 3000) is served at a particular domain server address

Alex C picture Alex C · May 14, 2011 · Viewed 9.5k times · Source

I've built a node.js-express app. By default it is listening on port 3000. I have the system hosted on an EC2 instance and have pointed a domain's A record to the AWS elastic IP address.

I'd like for HTTP requests to the domain name to automatically be directed to port:3000 or I'd like to be able to start the Express HTTP server up on port 80. (I tried starting up the node http server on port 80 but got an error)

I can access the node app if I type www.myurl.com:3000 but I need to be able to drop that requirement for the good of the end users.

Does anyone know how to make node and ports and domains all play nicely together on my amazon-buntu server?

Answer

Geoff Chappell picture Geoff Chappell · May 15, 2011

I found this article helpful when I had that same problem:

http://www.debian-administration.org/articles/386

I ended up using authbind -- once configured you just do:

authbind node myscript