Home >Web Front-end >JS Tutorial >Tomcat's default port number
Tomcat’s default port number is 8080, but you can customize the port number by editing the Connector element in the configuration file.
Tomcat’s default port number
Tomcat is a Java Servlet container for hosting in Java EE (Java Web applications in Platform Enterprise Edition). When Tomcat is installed, it uses default port numbers so that web clients can access applications hosted on it.
Default port number
Tomcat’s default port number is 8080. This means that when you enter a URL into your browser, if you don't specify a port number, the 8080 port number is automatically used. For example, if you visit https://example.com, your browser will try to connect to https://example.com:8080.
Custom port number
In some cases, you may want to change Tomcat's default port number. This can be achieved by editing Tomcat's configuration file. The Connector
element located in the conf/server.xml
file specifies the port number:
<code class="xml"><Connector port="8080" protocol="HTTP/1.1" ... /></code>
To change the port number, simply modify the value of the port number, for example:
<code class="xml"><Connector port="9090" protocol="HTTP/1.1" ... /></code>
After saving the changes and restarting Tomcat, Tomcat will use the new port number.
The above is the detailed content of Tomcat's default port number. For more information, please follow other related articles on the PHP Chinese website!