How to have Tomcat bind to port 80 and still run as a non-root user

Filed Under (Installations, Web) by jc on 26-07-2008

Tagged Under :

In order to have Tomcat listen on port 80, you either have to have it running as root (which by the way is not a very good idea), or configure a wrapper like JSCV.

Here is how you do it (This is an example using tomcat 6 please adapt to your install):

# cd /opt/apache-tomcat-6.0.16/bin/
# tar -zxvf jsvc.tar.gz
# cd jsvc-src
# chmod +x configure
# ./configure ; make
# cp jsvc ..

——————

Change your connection in server.xml to use port 80.

—————–

Start tomcat with a variation of the following init script:

tomcatjsvc.txt

As usual, let me know if you find any errors or a better way of doing it.

–JC

Comments:

One Response to “How to have Tomcat bind to port 80 and still run as a non-root user”


  1. I am looking for some idea and stumble upon your posting :) decide to wish you Thanks. Eugene

Leave a Reply