Feeds:
Posts
Comments

Archive for February, 2013

By default, tomcat listens on port 8080, which is specified in the following file./var/lib/tomcat7/conf/server.xml

<Connector port=”8080″ protocol=”HTTP/1.1″
connectionTimeout=”20000″
URIEncoding=”UTF-8″
redirectPort=”8443″ />

If you want tomcat to listen on a port other than 8080, you just need to make change to the file to modify 8080 to other number, save the file and restart tomcat. However, if you want tomcat to listen on port 80, it will work, that is bacause only root user can visit port numbers below 1024.

Here is the solution to set tomcat listening on port 80: Forward port 80 to port 8080

sudo iptables -t nat -A PREROUTING -p tcp –dport 80 -j REDIRECT –to-port 8080
sudo iptables-save > ~/my_iptables.rules

or if you have saved the iptables, you can restore it:
sudo iptables-restore < ~/my_iptables.rules

Read Full Post »