linux同时启动多个tomcat

今天下班学习nginx负载均衡时,需要多个tomcat端口服务,在一台机启动多个tomcat服务,于是记录下操作过程。

复制tomcat

原tomcat端口默认8080,复制出的tomcat端口8081。

1578923845682

编辑环境变量

1578923929147

贴出来

#tomcat_8080
export CATALINA_HOME=/root/service/tomcat_8080
export CATALINA_BASE=/root/service/tomcat_8080
export TOMCAT_HOME=/root/service/tomcat_8080

#tomcat_8081
export CATALINA_HOME2=/root/service/tomcat_8081
export CATALINA_BASE2=/root/service/tomcat_8081
export TOMCAT_HOME2=/root/service/tomcat_8081

使配置文件生效

source .bash_profile

修改第二份catalina.sh

cd /root/service/tomcat_8081/bin

添加

export CATALINA_BASE=$CATALINA_BASE2
export CATALINA_HOME=$CATALINA_HOME2

1578924182554

修改第二份修改server.xml

cd /root/service/tomcat_8081/conf

将三个端口从上到下,一次修改为800680818010

OK,配置完成

启动两个tomcat

1578924369993

Last modification:January 13th, 2020 at 10:39 pm
If you think my article is useful to you, please feel free to appreciate