如题,本次博文的内容是在一台Linux上搭建2个tomcat,很蛋疼的需求,但必须得做
1,复制原tomcat并重命名tomcat
cp /usr/local/tomcat /usr/local/tomcat2
修改外部环境
vim /etc/profile export JAVA_HOME=/usr/java/jdk1.8.0_73 export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tool.jar export TOMCAT_HOME=/usr/local/tomcat export CATALINA_HOME=/usr/local/tomcat export CATLINA_BASE=/usr/local/tomcat export TOMCAT_HOME_2=/usr/local/tomcat2 export CATALINA_HOME_2=/usr/local/tomcat2 export CATLINA_BASE_2=/usr/local/tomcat2
3,重载profile文件
source /etc/profile
[[email protected] webapps]# echo $TOMCAT_HOME
/usr/local/tomcat
[[email protected] webapps]# echo $TOMCAT_HOME_2
/usr/local/tomcat2
4,修改tomcat 配置文件
vim /usr/local/tomcat2/bin/catalina.sh
:%s/CATALINA_HOME/CATALINA_HOME_2/g
39 次替换,共 33 行
notice:部署了vm还得在此文件中将vm的18999改成19999
5,修改conf里面的server.xml
<Server port="8105" shutdown="SHUTDOWN">
<Connector port="8180" protocol="HTTP/1.1"
<Connector port="8109" protocol="AJP/1.3"
此3处端口需更换
6,启动即可
7,结果验证
END !
时间: 2024-10-05 16:25:36