Tomcat, by default runs on port 8080. You may want to make it run on port 80. Changing the port to 80 in the tomcat configurations wont work as port 80 is a privileged port and needs user with admin/root privileges. Making tomcat run as a root user is a big no no as well, as it could compromise your tomcat installation. The best solution to make tomcat work on port 80 is to do a port redirect using iptables.

Port redirect: 80 => 8080

Here is a two liner solution to enable port redirection from port 80 to 8080 on a linux server

iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080
iptables -t nat -A OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 8080

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)

What is 15 + 15 ?
Please leave these two fields as-is:

site tracking with Asynchronous Google Analytics plugin for Multisite by WordPress Expert at Web Design Jakarta.