Why does Tomcat work with port 8080 but not 80?

Two typical reasons:

  • You quite possibly don't have permission to listen to a port lower than 1024 (usually requires administrative privileges, e.g. being root)
  • Something else may already be listening on port 80 (e.g. apache)

go to /etc/default/tomcat6 and change #AUTHBIND=no to AUTHBIND=yes

 # 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=no

If nothing of the commented before works (like it happened to me), you can direct the traffic from the port 80 to the 8080.

To do it:

http://forum.slicehost.com/index.php?p=/discussion/2497/iptables-redirect-port-80-to-port-8080/p1

In a nutshell, type this three commands in a terminal:

$ sudo iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT
$ sudo iptables -A INPUT -i eth0 -p tcp --dport 8080 -j ACCEPT
$ sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080