In this post, We will learn Why and how to Change the Default Port of the Apache Tomcat Server?
As we know that the default port of tomcat is (8080) sometimes it may conflict with an existing application or server on your machine(for example, another web application or server already uses this port). If such a conflict exists then we need to change the default port of tomcat.
Steps are below to change Tomcat port:
1. Locate the file server.xml in {Tomcat installation folder}\conf where the directory in which you installed Tomcat.
2. In the server.xml file you will find a statement similar to the following:
1 |
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/> |
Or
1 2 3 4 |
<Connector executor="tomcatThreadPool" port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> |
Now you change the Connector port=”8080″ port to any other four digits port number.
For example:
1 |
<Connector connectionTimeout="20000" port="9090" protocol="HTTP/1.1" redirectPort="8443"/> |
3. Save the server.xml file and restart the Tomcat server.
You May Also Like:
What is Apache Tomcat?
What is SSL (Secure Sockets Layer)?
That’s all about How to Change the Default Port of the Tomcat Server?