Linux配置多个Tomcat同时运行

Linux系统下怎样配置多个Tomcat同时运行呢,首先修改变量为第一个tomcat,然后修改第二个tomcat启动的脚本

1、修改 对应tomcat中的 catalina.sh,添加环境变量:(区分两个名称即可)
#vi catalina.sh

	export CATALINA_BASE=$CATALINA_0_BASE
	export CATALINA_HOME=$CATALINA_0_HOME

2、 修改 tomcat的配置文件 server.xml:
修改下面标记的端口即可,防止端口占用:

    <!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL/TLS HTTP/1.1 Connector on port 8080
    -->
    <Connector port="8081" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    -->
    <!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443
         This connector uses the NIO implementation. The default
         SSLImplementation will depend on the presence of the APR/native
         library and the useOpenSSL attribute of the
         AprLifecycleListener.
         Either JSSE or OpenSSL style configuration may be used regardless of
         the SSLImplementation selected. JSSE style configuration is used below.
    -->

3、修改环境变量
#vi /etc/profile

 ####### 工程1 tomcat1#######
export CATALINA_BASE=/data/server/tomcat
export CATALINA_HOME=$CATALINA_BASE
export TOMCAT_HOME=$CATALINA_BASE

#######  工程2  tomcat2#######
export CATALINA_2_BASE=/data/tomcat-upgrade
export CATALINA_2_HOME=$CATALINA_2_BASE
export TOMCAT_2_HOME=$CATALINA_2_BASE


#######  工程3  tomcat3#######
export CATALINA_3_BASE=/data/tomcat-ifengSearch
export CATALINA_3_HOME=$CATALINA_3_BASE
export TOMCAT_3_HOME=$CATALINA_3_BASE


########  JAVA  jdk  环境 #########
export JAVA_HOME=/data/jdk1.7
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

保存退出。
  #source /etc/profile

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值