AuthBind configuration in Tomcat port 8080 to 80, 8443 to 443 on ubuntu - TechBeginner

Welcome to TechBeginner.in, Tech Beginner provides technical blog for Online Linux Tutorials, Ubuntu Tutorials, Redhat Tutorials and CentOS 7, Configuration of server like Web Server, Application server, Database server, Window server, networking, html, css, java script, php, wordpress, opencart, magento, joomla and etc.

AuthBind configuration in Tomcat port 8080 to 80, 8443 to 443 on ubuntu

Share This


 

By default Apache tomcat work on port 8080 and 8443, If we have requirement to 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.

 

 

 

No comments:

Post a Comment