Skip to content
Akshay Kodali edited this page May 20, 2015 · 5 revisions

By default Unix will not let you run a non privileged service on a port less than 1024, obviously you will want to run your web server on port 80 or port 443 for https. There are a few options for you to do this.

First, you can run it on port 8001 and have your load balancer route from port 80 to whatever port you are running internally.

If you want to run on port 80 there are a number of ways to do it, this document from the Yaws web site will prove helpful

http://hyber.org/privbind.yaws

I use these iptables commands to let me map port 80 to boss's 8001

   iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT
   iptables -A INPUT -i eth0 -p tcp --dport 8001 -j ACCEPT
   iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8001