Modify the tomcat default port number

  • 2020-05-14 05:37:51
  • OfStack

The cooperative management system USES the default Tomcat port 8080, and Tomcat also USES ports 8005,8009 and 8443. If these four ports are already occupied, the co-management system can be modified to use other ports.

The modification method is as follows:

1. If the machine is equipped with IIS or Apache Server and only occupies port 8080:

Edit file "installation directory \tomcat\conf\ server.xml" (open with notepad)

Find "8080" (as shown in the red letter below), replace it with the port number you want to set (such as 9090), and save it.

< Connector port="8080"

2. If it is because tomcat is already installed on the server and the default port is used, you need to edit the file "installation directory \tomcat\conf\ server.xml" (open with notepad).

Search and modify the four port Numbers (as shown in the red letter) :

< Server port="8005" shutdown="SHUTDOWN" >
< Connector port="8080"
< Connector port="8009" enableLookups="false" redirectPort="8443" protocol="AJP/1.3" / >

Make sure the modified port is not occupied. For example:

< Server port="9005" shutdown="SHUTDOWN" >
< Connector port="9090"
< Connector port="9009" enableLookups="false" redirectPort="9443" protocol="AJP/1.3" / >

Note:
1. After the port number is modified, the current online user can no longer use the system, so it is necessary to restart tomcat and log in again with the new port number.
2. Only when tomcat is already on the server and the cooperative management system (tomcat is also included) is installed this time, will the modification of the four ports be involved. If you don't have two tomcat on your server, simply change 8080 to the port number you need, as described in case 1.



Related articles: