centos7 配置 多个tomcat8
原创    loonbs    发表于:2018-05-29 11:06:26
  阅读 :120   收藏   编辑

上一篇:centos7 配置tomcat8

注意:java 和tomcat 目录均为 /install

复制tomcat8080环境变量

vim /etc/profile

# tomcat8080 conf 
CATALINA_8080_BASE=/install/tomcat8080
CATALINA_8080_HOME=/install/tomcat8080
TOMCAT_8080_HOME=/install/tomcat8080
export CATALINA_8080_BASE CATALINA_8080_HOME TOMCAT_8080_HOME
# tomcat8080 conf

# tomcat8081 conf 
CATALINA_8081_BASE=/install/tomcat8081
CATALINA_8081_HOME=/install/tomcat8081
TOMCAT_8081_HOME=/install/tomcat8081
export CATALINA_8081_BASE CATALINA_8081_HOME TOMCAT_8081_HOME
# tomcat8081 conf

配置生效

source /etc/profile

复制原来的tomcat8080的全部内容

cp -R tomcat8080 tomcat8081

修改tomcat8081变量

vim tomcat8081/bin/startup.sh  
 
第二行修改如下

export JAVA_HOME=/install/jdk1.8
export JAVA=$JAVA_HOME/bin:$PATH
export CLASSPATH=$JAVA_HOME/lib
export CATALINA_HOME=$CATALINA_8081_HOME
export CATALINA_BASE=$CATALINA_8081_BASE

vim tomcat8081/bin/shutdown.sh 
 
第二行修改如下

export JAVA_HOME=/install/jdk1.8
export JAVA=$JAVA_HOME/bin:$PATH
export CLASSPATH=$JAVA_HOME/lib
export CATALINA_HOME=$CATALINA_8081_HOME
export CATALINA_BASE=$CATALINA_8081_BASE

修改tomcat8081的相关端口

vim tomcat8081/conf/server.xml 

22行
<Server port="8005" shutdown="SHUTDOWN">
修改为
<Server port="8006" shutdown="SHUTDOWN">

69行
<Connector port="8080" protocol="HTTP/1.1"
修改为
<Connector port="8081" protocol="HTTP/1.1"

116行
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
修改为
<Connector port="8010" protocol="AJP/1.3" redirectPort="8443" />

启动

./tomcat8080/bin/startup.sh 

Using CATALINA_BASE:   /install/tomcat8080
Using CATALINA_HOME:   /install/tomcat8080
Using CATALINA_TMPDIR: /install/tomcat8080/temp
Using JRE_HOME:        /install/jdk1.8/jre
Using CLASSPATH:       /install/tomcat8080/bin/bootstrap.jar:/install/tomcat8080/bin/tomcat-juli.jar

./tomcat8081/bin/startup.sh 


Using CATALINA_BASE:   /install/tomcat8081
Using CATALINA_HOME:   /install/tomcat8081
Using CATALINA_TMPDIR: /install/tomcat8081/temp
Using JRE_HOME:        /install/jdk1.8/jre
Using CLASSPATH:       /install/tomcat8081/bin/bootstrap.jar:/install/tomcat8081/bin/tomcat-juli.jar
Tomcat started.

浏览器访问IP:8080和IP:8081

评论
条评论

推荐阅读