1、下载tomcat软件包
#下载软件包
wget https://archive.apache.org/dist/tomcat/tomcat-8/v8.5.28/bin/apache-tomcat-8.5.28.tar.gz
#创建解压目录
mkdir -p /home/hermes/application
#解压
tar -zxvf apache-tomcat-8.5.28.tar.gz -C /home/hermes/application
2、复制tomcat为多个
cd /home/hermes/application
cp apache-tomcat-8.5.28 ./
mv apache-tomcat-8.5.28 tomcat1
mv apache-tomcat-8.5.28 tomcat2
mv apache-tomcat-8.5.28 tomcat3
3、配置profile
vim /etc/profile
CATALINA_BASE=/home/hermes/application/tomcat1
CATALINA_HOME=/home/hermes/application/tomcat1
TOMCAT_HOME=/home/hermes/application/tomcat1
CATALINA_BASE2=/home/hermes/application/tomcat2
CATALINA_HOME2=/home/hermes/application/tomcat2
TOMCAT_HOME2=/home/hermes/application/tomcat2
#生效
source /etc/profile
4、修改tomcat端口配置
vim /home/hermes/application/tomcat1/conf/server.xml
22 <Server port="8005"
69 <Connector port="8088" protocol="HTTP/1.1"
116 <Connector port="8009" protocol="AJP/1.3"
#注意端口 不要重复否则启动失败
vim /home/hermes/application/tomcat2/conf/server.xml
22 <Server port="8015"
69 <Connector port="8018" protocol="HTTP/1.1"
116 <Connector port="8019" protocol="AJP/1.3"
5、启动tomcat
sh /home/hermes/application/tomcat1/bin/startup.sh
sh /home/hermes/application/tomcat2/bin/startup.sh
6、访问
http://tomcat1
http://tomcat2