1.参考前文安装jdk、第一个tomcat

2.安装第二个tomcat后,修改/etc/profile

  vi /etc/profile

  #tomcat1
  export CATALINA_BASE=/opt/tomcat1
  export CATALINA_HOME=/opt/tomcat1
  export TOMCAT_HOME=/opt/tomcat1

  #tomcat2
  export CATALINA_BASE2=/opt/tomcat2
  export CATALINA_HOME2=/opt/tomcat2
  export TOMCAT_HOME2=/opt/tomcat2

  source /etc/profile

3.修改server.xml文件

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

  <Connector port="8081" protocol="HTTP/1.1" connectionTimeout="20000" 

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

4.修改catalina.sh

  在 # OS specific support.  $var _must_ be set to either true or false. 后添加下列两行代码

  export CATALINA_BASE=$CATALINA_BASE2

export CATALINA_HOME=$CATALINA_HOME2

5.启动tomcat

6.多台tomcat以此类推

 

相关文章:

  • 2021-08-06
  • 2021-09-04
  • 2021-12-19
猜你喜欢
  • 2021-12-30
  • 2022-12-23
  • 2022-01-18
  • 2022-12-23
  • 2021-11-28
  • 2021-06-16
相关资源
相似解决方案