Tomcat does not run on port 80 as non-root

January 30, 2008 · Posted in linux 

It is not recommended to make tomcat listen in 80 port, since Tomcat would need to run as a privileged user.

It is suggested either you redirect the port traffic using iptables .

# /sbin/iptables -A FORWARD -p tcp --destination-port 80 -j ACCEPT
# /sbin/iptables -t nat -A PREROUTING -j REDIRECT -p tcp
--destination-port 80 -to-port 8080
# /sbin/iptables-save

Please remember that in this case clients connecting from server itself have to connect to 8080 port itself.

OR

Another option is to use Apache as a front end to all requests and use modules to redirect to tomcat.

Comments

One Response to “Tomcat does not run on port 80 as non-root”

  1. DC Global on February 17th, 2008 6:56 PM

    Aaaahhh…… Now I know..
    nice post

Leave a Reply