The default port number of Tomcat server is 8080, which can be modified to other port numbers. It can be modified through server startup parameters or configuration files: Server startup parameters: Specify the port number when starting from the command line, such as: catalina.sh start --server.port=8081 Configuration file: Edit /conf/server.xml, modify
and save the changes and restart the server.
How to modify the default port number of the Tomcat server?
The default port number of the Tomcat server is 8080, but you can modify this port number when the server starts or through the configuration file.
Modify the server startup parameters:
<code>catalina.sh start --server.port=8081</code>
<code>catalina.bat start /Dserver.port=8081</code>
Modify through the configuration file:
/conf/server.xml
file in the Tomcat installation directory. <code class="xml"><Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /></code>
port
attribute to your desired port number. For example, to change the port number to 8081, modify it as follows: <code class="xml"><Connector port="8081" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /></code>
Additional Notes:
The above is the detailed content of How to modify the default port number of tomcat server. For more information, please follow other related articles on the PHP Chinese website!