starting tomcat on port 80 on CentOS release 5.5 (Final)

前端 未结 6 1559
傲寒
傲寒 2021-02-05 15:17

I want to start Tomcat 6.0.29 on port 80. My OS is CentOS release 5.5 (Final) I changed following line in $TOMCAT_HOME/conf/server.xml



        
6条回答
  •  我在风中等你
    2021-02-05 15:50

    The ports in the range 1-1023 are privileged. Only root is allowed to bind to them.

    There is at least two ways to solve this:

    • Run as root. You need to weight the extra security risks this infers, of course; both security holes in Tomcat itself (which I believe to be few) and those your web applications contains (which can for example lead to letting people read /etc/shadow as an example), against this being simple and straight-forward.

    • Run as service with jsvc. See http://tomcat.apache.org/tomcat-5.5-doc/setup.html for details on jsvc. It is some extra hassle to setup, but root will only be involved in setting up the ports, Tomcat will then run as a user without special rights. I recommend this for any serious setup.

    Regardless on what way you choose, the actual starting of Tomcat will need root privilegies.

    ///BR, JenEriC

提交回复
热议问题