So you have changed the port on which Tomcat is served within the server.xml to port 80. Now you restart Tomcat which gives you the following catalina.out error:

 
SEVERE: java.net.BindException: Permission denied<null>:80 - 

After quite a lot of ‘Googling’ the fix was actually quite straight forward.

Simply edit the tomcat7 config file located in /etc/default/tomcat7:

 
vim /etc/default/tomcat7 

Uncommend ‘AUTHBIND=no’ and change to AUTHBIND=yes.

e.g.


# If you run Tomcat on port numbers that are all higher than 1023, then you
# do not need authbind. It is used for binding Tomcat to lower port numbers.
# NOTE: authbind works only with IPv4. Do not enable it when using IPv6.
# (yes/no, default: no)
AUTHBIND=yes

Restart tomcat and that’s you running on port 80.

NOTE: Default installation of Tomcat 7 for Debian binds only ports higher than 1023 (Port 8080 by default). The above commands allows binding to privileged ports.

Written by Matt Cooper
Hi, I'm Matt Cooper. I started this blog to pretty much act as a brain dump area for things I learn from day to day. You can contact me at: matt@linuxtutorial.co.uk.