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

Installations, Web 1 Comment

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