Jul
26
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 : tomcat JSVC
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:
As usual, let me know if you find any errors or a better way of doing it.
–JC
