Run Tomcat7 on Port 80
You may need to run Tomcat on port 80 for many reasons. It is possible to accomplish this in three steps.
First step is move 8080 to port 80.Find your server.xml file for Tomcat. It is probably under /etc/tomcat/server.xml but still
you can find it by using:
Open server.xml file with an avaliable text editor (I will use nano).
Find the part where port is defined as 8080 and change it to 80.
Close the file by saving it. If you run tomcat now it will complain about some authentication errors. It happens because we are trying to run Tomcat under 1023 ports. So the next step is enable authbind for tomcat. 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. Open /etc/default/tomcat with your text editor.
Switch authbind=no to authbind=yes which is located at the end of file.
The last step is disabling IPv6. You can see the warning just before authbind line saying that “NOTE: authbind works only with IPv4. Do not enable it when using IPv6.”. Open /etc/sysctl.conf with your text editor.
And add these three lines to end of the file.
Save the file and close it. To make sure IPv6 is disabled run
and you will see
After that, if you run:
It will report: 1
Now it is ready to run on port 80. Start your tomcat with
If you look at your catalina.out logs it will be written in there as
Now you can access your services directly without any port like
example.com/Services/