Linux系统下配置两个Tomcat同时运行

1、修改环境变量

# vim /etc/profile

 

####### tomcat1 #######

export CATALINA_BASE=/www/tomcat/autotest/apache-tomcat-8.5.45

export CATALINA_HOME=$CATALINA_BASE

export TOMCAT_HOME=$CATALINA_BASE

 

####### tomcat2 #######

export CATALINA_2_BASE=/www/tomcat/fronthmtl

export CATALINA_2_HOME=$CATALINA_2_BASE

export TOMCAT_2_HOME=$CATALINA_2_BASE

保存退出。

 

2、使配置生效

# source /etc/profile

 

3、修改 对应tomcat2中的 catalina.sh,添加环境变量

# vim /www/tomcat/fronthmtl/bin/catalina.sh

export CATALINA_BASE=$CATALINA_2_BASE

export CATALINA_HOME=$CATALINA_2_HOME

 

4 修改 tomcat的配置文件 server.xml

#vim /www/tomcat/fronthmtl/conf/server.xml

修改下面标记的端口即可,防止端口占用

<Server port="8015" shutdown="SHUTDOWN">

 

<Connector port="8089" protocol="HTTP/1.1"

               connectionTimeout="20000"

               redirectPort="8443" />

 

<Connector port="8019" protocol="AJP/1.3" redirectPort="8443" />

 

两个tomcat都可以启动,则配置成功

posted @ 2020-03-21 16:08  沫笙*  阅读(399)  评论(0编辑  收藏  举报