Tomcat 8 run on port 80 instead of 8080

By default Tomcat 8.5 runs on port 8080, there are multiple ways of making Tomcat accessible on port 80. Today we will cover the most simple way to do this. The examples below are related to Tomcat 8.5 running on Debian 9. Please make adjustments related to your Linux distribution.

I always recommend to take a backup of any file we would edit. So initially we take a back up of

cp /etc/tomcat8/server.xml /etc/tomcat8/server.xml.default

use your favorite text editor to open /etc/tomcat8/server.xml

nano /etc/tomcat8/server.xml

in the server.xml search for

<Connector port="8080"

simply change 8080 to 80 save and close the file

If you restart Tomcat now, you will get errors about permissions, This is because any port below 1024 is a privileged port on Linux and Tomcat’s default installation does not have privilege to use ports below 1024. We will use authbind to achieve our goal

open the file /etc/defaults/tomcat8





restart Tomcat

service tomcat8 restart

you should be able to access it using port 80

Leave a Reply

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