Introduction: Tomcat can access http://ip:8080 after the default installation is complete, if the page appears. If you want to run more than one tomcat on a server, how do I set it up?
Method:
Re-copy the Cp-r tomcat tomcat2 from the directory where Tomcat is installed, and then go to conf/server.xml change profile in the TOMCAT2 directory
The following is the default configuration file,
<server port= "8005" shutdown= "Shutdown" > ... <connector connectiontimeout= "20000" port= "8080" Protocol= "Org.apache.coyote.http11.Http11NioProtocol" redirectport= "8443"/> <connector port= "8009" prot Ocol= "ajp/1.3" redirectport= "8443"/></server>
Because once a port is bound, other processes can no longer bind, so we modify these ports to other values. Modify the Server.xml file, configure server port =8105,connector port = 8181,AJP Port = 8109,rediretport=81443 The following is the changed
<server port= "8105" shutdown= "Shutdown" > ... <connector connectiontimeout= "20000" port= "8181" Protocol= "Org.apache.coyote.http11.Http11NioProtocol" redirectport= "81443"/> <connector port= "8109" PR Otocol= "ajp/1.3" redirectport= "81443"/></server>
Finally enter into the tomcat2/bin/./startup.sh to start the service can be
To see if the port is started
NETSTAT-LNP | grep 8105
Verify:
I visit: http://192.168.234.128:8080 and http://192.168.234.128:8081
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/85/25/wKiom1ea9_vSNhYqAADQI4GrIw4270.png "style=" float: none; "title=" 1.png "alt=" Wkiom1ea9_vsnhyqaadqi4griw4270.png "/>
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/85/25/wKioL1ea9_uy2cJEAAA6xkBRv00321.png "style=" float: none; "title=" 2.png "alt=" Wkiol1ea9_uy2cjeaaa6xkbrv00321.png "/>
If more instances are needed, copy the program directory in turn and modify the port of the configuration file.
This article is from the "Drifting Away" blog, make sure to keep this source http://825536458.blog.51cto.com/4417836/1831701
Tomcat Multi-instance configuration