Tomcat Multiple Ports Configuration Guide

To configure multiple ports for Tomcat, you can follow these steps:

  1. Open the configuration file of Tomcat, which is usually located in the conf folder under the installation directory of Tomcat.
  2. Find the following:
<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
  1. Copy the above Connector configuration and change the port number, for example:
<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
<Connector port="8081" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
  1. Save the server.xml file and restart Tomcat.

Tomcat is now listening on both port 8080 and port 8081, allowing access to the server via http://localhost:8080/ and http://localhost:8081/.

bannerAds