By default Apache tomcat work on port 8080 and 8443, If we have requirement to use Apache tomcat on port 80 and 443 so in that case, We need to do some configure in server.xml and also we need to use authbind package to achieve this requirement.
In this post, We will configure Apache Tomcat port 8080 to port 80 using ubuntu 20.04 LTS
Step 1: Chnage the port number in server.xml
You need to use the following command to change port 8080 to port 80.
sudo vim <tomcat_home_directory>/conf/server.xml
You should get configuration like this.
<Connector port="8080" //Make change here
protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
/>
After find the port configuration, You need to change port 8080 to 80.
<Connector port="80" // Change like this
protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
/>
Save exit from your editor.
Step 2: Configure AuthBind Package
Use the following command to install authbind
sudo apt-get install authbind -y
Open server.xml config file and enable authbind
sudo vim server.xml
Add the given syntax
AUTHBIND=yes
Save and exit from the text editor.
Update the required permission
sudo touch /etc/authbind/byport/80
sudo chmod 500 /etc/authbind/byport/80
sudo chown tomcat8 /etc/authbind/byport/80
Step 3: Restart the Apache Tomcat service
To get new changes, We need to restart the Apache tomcat service by using following command.
sudo systemctl restart tomcat.service
Conclusion
We have successfully change the default port number with Apache Tomcat on Ubuntu 20.04 server.
Get connected with our new devops tools based website- https://www.devopstricks.in/
Where to put the "AUTHBIND=yes" in server.xml?
You helped me a lot with this post. I love the subject and I hope you continue to write excellent articles like this.
Thank you for providing me with these article examples. May I ask you a question?
Sure.
Wow, superb blog layout! How long have you been blogging for? you make blogging look easy. The overall look of your site is excellent, let alone the content!