Tomcat7 bind to port 80 fails in Ubuntu 14.04LTS

后端 未结 4 1728
故里飘歌
故里飘歌 2021-01-30 04:15

I\'ve got a problem with my tomcat7 installation on a newly updated Ubuntu system. Ever since the update to 14.04 LTS, tomcat refuses to start on port 80 with an error that I ca

4条回答
  •  情深已故
    2021-01-30 04:41

    Start tomcat services using authbind this will allow user to start ports less than 1024 we do not need to redirect or iptables.

    apt-get install authbind -y

    To install Authbind software

    chmod -R 755 /etc/authbind

    group should be user group.

    chown -Rh root:group /etc/authbind

    After that run the below commands

    cd /etc/authbind/byuid

    As an example lets imagne user id is 2000 you can use your user id number

    echo '0.0.0.0/0:1,1023' > 2000

    That file should be own by user and group.

    chown : 2000

    chmod 700 2000

    Add the below line in tomcat startup file $CATALINA_BASE/startup.sh

    export JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true"
    

    For Starting tomcat using Authbind service startup.sh

    Comment the below line

    #$CATALINA_HOME/bin/startup.sh
    

    Add This End as the end of the file

    AUTHBIND_COMMAND="/usr/bin/authbind --deep /bin/bash -c " 
    
    $AUTHBIND_COMMAND $CATALINA_HOME/bin/startup.sh   
    

    now you should be able to start tomcat services as user with less that 1024 ports.

提交回复
热议问题