You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Joel Palmius <jo...@mh.se> on 2003/01/19 18:38:39 UTC

Tomcat4 on port 80, standalone, unprivileged user

I've been searching for some time for info on how to run Tomcat4 
standalone on port 80. It seemed overkill to involve apache just for this, 
and running tomcat as root was just plain scary. 

Changing connector port without any other measures just renders a
"java.net.BindException: Permission denied:80"

I've not seen anyone mentioning the below solution before, sorry if I
missed it, but this is how you run Tomcat4 on port 80 standalone without
involving apache and without running it as root, with as little tinkering 
as possible:

(this solution is probably only valid for linux, and possibly only after 
an rpm install of tomcat)

  * Change connector port to 80 in server.xml.

  * Download, make and make install "authbind". The source tarball can be 
    found at http://packages.debian.org/unstable/utils/authbind.html

  * Run 

      touch /etc/authbind/byport/80
      chmod 500 /etc/authbind/byport/80
      chown tomcat4 /etc/authbind/byport/80

  * Open /usr/bin/dtomcat4 in a text editor. Around line 205, on the line 
    that calls "$_RUNJAVA" to start the tomcat process, insert
 
      /usr/local/bin/authbind --deep 

    so the line reads

      /usr/local/bin/authbind --deep "$_RUNJAVA"....

  * Start tomcat as usual

.. and voila.. The processes still run as tomcat4, and you can access your 
tomcat server without having to add :8080 in the url. 

The above is *a* solution, I'm not saying anything about whether it is a 
*good* solution. It seems to work though. The solution was tested with 
Mandrake 9.0 and Tomcat 4.1.

Cheers. 

  // Joel


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>