欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Centos7 一台服务器配置多台tomcat

程序员文章站 2022-03-11 17:37:35
...

1.下载安装tomcat8 ,然后拷贝一份

2.添加环境变量

[[email protected] ~]# vi /etc/profile

export CATALINA_BASE_01=/usr/local/src/tomcat8-01
export CATALINA_HOME_01=/usr/local/src/tomcat8-01

 

export CATALINA_BASE_02=/usr/local/src/tomcat8-02
export CATALINA_HOME_02=/usr/local/src/tomcat8-02

 

 

 

 

3.生效配置文件

[[email protected] ~]# source /etc/profile

4.修改tomcat启动catalina.sh文件

[[email protected] ~]# cd /usr/local/src/tomcat8-01/bin/
[[email protected] bin]# vi catalina.sh 

export CATALINA_BASE=$CATALINA_BASE_01
export CATALINA_HOME=$CATALINA_HOME_01

export CATALINA_BASE=$CATALINA_BASE_02
export CATALINA_HOME=$CATALINA_HOME_02

 

 

 

 

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

 tomcat8-01的server.xml进行修改:8005-->12005 ; 8080 -->12080; 8009 --> 12009

 tomcat8-02的server.xml进行修改:8005-->13005 ; 8080 -->13080; 8009 --> 13009

6.启动对应的tomcat

[[email protected] ~]# cd /usr/local/src/tomcat8-01/bin/
[[email protected] bin]# ./startup.sh 

 

相关标签: tomcat