The project that was done in the previous period, because it is to the mobile phone client server, so the client needs to access my server during the development process.
The problem is that I am also developing, and do not join the hot deployment, it is bound to cause frequent server restarts, which will have a certain impact on client development.
At this point you need to run two Tomcat, one I developed with, one for the client. so the question is, how do you run 2 tomcat at the same time on a single computer?
If nothing is configured, let's run two Tomcat to try:
Error, indicating that our port number 8005 is occupied. Tomcat uses port 8005 by default to listen for requests to close Tomcat
So the port number cannot be duplicated, so we can change it by modifying Tomcat's Conf/server.xml file.
This port is defined in the Server tab, port represents the port number, and shutdown represents the request command to shut down the server, for example, we changed to 8006
<server port= "8006" shutdown= "Shutdown" >
for a Tomcat server that is already turned on, you can connect using the telnet localhost 8005 command under cmd and enter "SHUTDOWN" command to shut down the server.
Modifying this port is not enough, presumably you should have thought of it, because Tomcat boot by default also consumes 8080 ports to listen for user requests.
So look in the server.xml to see 8080, about 69 rows or so, find to change it to 8090:
<connector port= "8090" protocol= "http/1.1" connectiontimeout= "20000" redirectport= "8443" >
Looking down a few lines, we will see a 8009 port number, what is this? Regardless of it, try to open two tomcat at a time first:
Eh, have you already succeeded? The Tomcat interface can be seen at this time through localhost:8080 or localhost:8090
But if you look closely, you'll find a few words at the bottom.
Info: Port busy 8009 java.net.BindException:Address already in Use:jvm_bind critical: Can ' t find free Port 8009 8009
Does this port still impress? Just seen in Server.xml, this is the second connector that Tomcat comes with, it listens on port 8009 and is responsible for establishing connections with other HTTP servers. When you integrate Tomcat with other HTTP servers, you need to use this connector. Know the use of it, in fact, in our project does not use this port, then change the port number is not really a matter ~
How to run 2 tomcat at the same time on a single computer