Home > Article > Web Front-end > How to change the default port of tomcat
Tomcat's default port is 8080, which can be changed by following these steps: Modify the port attribute of the <Connector> element in the server.xml file. Save the changes and restart the Tomcat server. Verify the change in your browser using the new port number, such as http://localhost:8090/.
How to change the default port of Tomcat
The default port of Tomcat is 8080, but it can be changed if needed . The process of changing the port is very simple. You can follow the following steps:
Modify the port number
conf
in the Tomcat installation directory folder. server.xml
file and open it. <Connector>
element, which defines the port number of the server. <Connector>
element, find the port
attribute. port
attribute to the desired new port number. For example, to change the port number to 8090, the <Connector>
element would look like this:
<code class="xml"><Connector port="8090" protocol="HTTP/1.1" connectionTimeout="20000" ... /></code>
Save and Restart
server.xml
file. Verify port change
After restarting the server, you can verify the port number by entering the new port number in the browser address bar (such as http:// localhost:8090/
) to verify that the port has changed. If you see the Tomcat welcome page, the port has been changed successfully.
The above is the detailed content of How to change the default port of tomcat. For more information, please follow other related articles on the PHP Chinese website!