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

7:56 pm Installations, Web

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

One Response

  1. Eugene Says:

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

Leave a Comment

Your comment

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove that you're not a bot, enter this code
Anti-Spam Image

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.