vi /etc/profile :
CATALINA_BASE=/home/apache-tomcat-8080
CATALINA_HOME=/home/apache-tomcat-8080
TOMCAT_HOME=/home/apache-tomcat-8080
export CATALINA_BASE CATALINA_HOME TOMCAT_HOME
##########first tomcat############
##########second tomcat##########
CATALINA_2_BASE=/home/apache-tomcat-8070
CATALINA_2_HOME=/home/apache-tomcat-8070
TOMCAT_2_HOME=/home/apache-tomcat-8070
export CATALINA_2_BASE CATALINA_2_HOME TOMCAT_2_HOME
##########third tomcat##########
CATALINA_3_BASE=/home/apache-tomcat-8090
CATALINA_3_HOME=/home/apache-tomcat-8090
TOMCAT_3_HOME=/home/apache-tomcat-8090
export CATALINA_3_BASE CATALINA_3_HOME TOMCAT_3_HOME
source /etc/profile
以第二个tomcat为例:
vi /usr/local/tomcat_2/bin/catalina.sh
在“# OS specific support. $var _must_ be set to either true or false.”下面添加:
export CATALINA_BASE=$CATALINA_2_BASE
export CATALINA_HOME=$CATALINA_2_HOME,第三个tomcat同理
配置第二个tomcat的启动、关闭监听端口。
8005->9005,8080->8081,8009->9009。第三个同理
P.S.修改或增加防火墙端口,
service iptables restart
iptables -L -n检查是否开启