Home >Web Front-end >JS Tutorial >How to change the tomcat port number that is occupied
Modify Tomcat’s port number by editing the server.xml file: Stop the Tomcat service. Open the server.xml file. Find the port attribute in the
element. Modify the value of the port attribute to the desired port number. Save the changes and restart the Tomcat service.
How to modify the Tomcat port number?
When the Tomcat port number is occupied, you can modify it through the following steps:
Step 1: Stop the Tomcat service
First, Stop the Tomcat service to prevent port conflicts.
Step 2: Edit port configuration
Open the Tomcat configuration file located in the ${catalina.home}\conf\server.xml file.
Step 3: Find the port number setting
In server.xml, find the following code segment:
<code class="xml"><Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /></code>
The port attribute specifies Tomcat's HTTP port number.
Step 4: Modify the port number
Modify the value of the port attribute to the required port number, for example:
<code class="xml"><Connector port="8090" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /></code>
Steps 5: Save and restart Tomcat
Save the changes and restart the Tomcat service. The new port number will take effect.
Note:
The above is the detailed content of How to change the tomcat port number that is occupied. For more information, please follow other related articles on the PHP Chinese website!