1, find Tomcat's home directory, open the Conf folder, find and open the Server.xml file.
Edit the Server.xml file and add it to the <Service></Service> tab:
<connector port= "9090" protocol= "http/1.1" connectiontimeout= "20000" redirectport= "8443"/>
As shown in figure:
2, the configuration in step 1, multiple ports are complete, save and start Tomcat.
Effects using 8080-Port access chart:
3, using 9090-port access to the effect of the map:
This enables different port numbers to be accessed to the same application. If you want to listen on another port, add a few more to step 2.
Second, tomcat to achieve multiple domain name access (through the same port number)
1. Description: In the case of the same port number, Tomcat can configure different domain names to correspond to different applications.
However, I am not sure whether the Domain name Management Server supports 2 different domain names mapped to the same port of the same IP address.
2, find Tomcat's home directory, open the Conf folder, find and open the Server.xml file.
Edit the Server.xml file and add it to the <Service></Service> tab:
As shown in figure:
3
3, proceed to the configuration in step 2, save and start Tomcat.
You can use domain1 access to Web1, and domain2 access to WEB2.
Three, tomcat to achieve multiple domain name access (using different port number)
1. Description: Relative to the second situation, the current situation should be widely used.
2, find Tomcat's home directory, open the Conf folder, find and open the Server.xml file.
Edit the Server.xml file and make a copy of the <Service>...</Service> label, modifying the Service name, listening port, domain name, and default loading application.
As shown in figure:
3
3, proceed to the configuration in step 2, save and start Tomcat.
You can use domain1 access to Web1, and domain2 access to WEB2.
4, note: The third situation and the second case the biggest difference is the use of another port number, which is also a common situation. (different domain name map to different port) end note To use domain name access, the user must first get the domain name address. Through Domain name Management Service, domain name address to be resolved into IP address + port number.
Summarize
The above is the entire content of this article, I hope the content of this article for everyone's study or work can help, if there is doubt you can message exchange.