具体步骤:
1.从上面网址下载文件,解压到本地,并拷贝一份或解压两份。形成两个目录:
2.分别打开两个目录下的bin/startup.bat文件,并在开头处增加两行:
tomcat01:
set JAVA_HOME="C:pleiadesjava8"
set CATALINA_HOME="D:Usersos-yang.hesoftware omcat omcat01"
tomcat02:
set JAVA_HOME="C:pleiadesjava8"
set CATALINA_HOME="D:Usersos-yang.hesoftware omcat omcat02"
4.为了避免端口冲突,需要修改一个tomcat的server.xml文件,这里选tomcat2,用文本编辑器打开tomcat02confserver.xml,将8005端口改成8006,8080端口改成8088,8009端口改成8010,一共三个。
<Server port="8006" shutdown="SHUTDOWN"> 。 。 。 <Connector port="8088" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> 。 。 。 <Connector port="8010" protocol="AJP/1.3" redirectPort="8443" /> 。 。 。
5.分别打开cmd窗口,进入bin所在目录,执行startup.bat:
D:Usersos-ufosoftware omcat>cd tomcat01 D:Usersos-ufosoftware omcat omcat01>cd bin D:Usersos-ufosoftware omcat omcat01in>startup.bat Using CATALINA_BASE: ""D:Usersos-ufosoftware omcat omcat02"" Using CATALINA_HOME: ""D:Usersos-ufosoftware omcat omcat02"" Using CATALINA_TMPDIR: ""D:Usersos-ufosoftware omcat omcat02" emp" Using JRE_HOME: ""C:pleiadesjava8"" Using CLASSPATH: ""D:Usersos-ufosoftware omcat omcat02"inootstrap.jar;"D:Usersos-ufosoftware omcat omcat02"in omcat-juli.jar" D:Usersos-ufosoftware omcat omcat01in>startup.bat Using CATALINA_BASE: ""D:Usersos-ufosoftware omcat omcat02"" Using CATALINA_HOME: ""D:Usersos-ufosoftware omcat omcat02"" Using CATALINA_TMPDIR: ""D:Usersos-ufosoftware omcat omcat02" emp" Using JRE_HOME: ""C:pleiadesjava8"" Using CLASSPATH: ""D:Usersos-ufosoftware omcat omcat02"inootstrap.jar;"D:Usersos-ufosoftware omcat omcat02"in omcat-juli.jar" D:Usersos-ufosoftware omcat omcat01in>
6.在浏览器中分别输入http://localhost:8088/ 和 http://localhost:8080/ 看看效果如何。
参考网文:
https://blog.csdn.net/qq_31463999/article/details/79197441
https://jingyan.baidu.com/article/0eb457e50fabcc03f0a9056d.html
--END-- 2019-12-26 10:51