第一個按照默認配置java
1.部署第二個tomcat。apache
[root@centos65 ~]# cd /home/software/centos
[root@centos65 software]# tar -zxvf apache-tomcat-7.0.73.tar.gztomcat
[root@centos65 software]# mv apache-tomcat-7.0.73 /usr/local/tomcat_project02spa
2.修改第二個tomcat的startup.sh.net
[root@centos65 ~]# vi /usr/local/tomcat_project02/bin/startup.shserver
#在文件前面#!/bin/sh下面,# Better前面加入如下兩個環境變量xml
export CATALINA_HOME=/usr/local/tomcat_project02部署
export CATLINA_BASE=/usr/local/tomcat_project02get
3.修改第二個tomcat的shutdown.sh
[root@centos65 ~]# vi /usr/local/tomcat_project02/bin/shutdown.sh
#在文件前面#!/bin/sh下面,# Better前面加入如下兩個環境變量
export CATALINA_HOME=/usr/local/tomcat_project02
export CATLINA_BASE=/usr/local/tomcat_project02
4.修改第二個tomcat的server.xml中的端口。(須要修改3個地方)
[root@centos65 ~]# vi /usr/local/tomcat_project02/conf/server.xml
#將下行中端口改爲8006
<Server port="8006" shutdown="SHUTDOWN">
#將下行中的8080改爲8081
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
#將下行中8009改爲8010
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
5.tomcat指定另外使用的jdk版本,修改Tomcat2個配置文件,"tomcat/bin/catalina.sh" 、 "tomcat/bin/setclasspath.sh" 、
1) 在catalina.sh文件和setclasspath.sh文件開頭的空白處加上以下兩句(指定JDK):
export JAVA_HOME=/usr/local/java/jdk1.8.0_161 export JRE_HOME=/usr/local/java/jdk1.8.0_161/jre
啓動與關閉
[root@centos65 ~]# /usr/local/tomcat_project02/bin/startup.sh
[root@centos65 ~]# /usr/local/tomcat_project02/bin/shutdown.sh