在centos同时装两个tomcat

在centos同时装两个tomcat

借鉴网址: http://wbande.blog.163.com/blog/static/303812572010511101812972/

 

JDK

vi /etc/profile

JAVA_HOME=/usr/local/jdk1.6.0_23
CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
PATH=$PATH:$JAVA_HOME/bin
JRE_HOME=$JAVA_HOME/jre
export JAVA_HOME
export PATH
export CLASSPATH

原有的为:tomcat7,新增加的为tomcat71  

1 在/etc/profile中添加以下粗体的配置

#原有的tocmat配置

#tomcat7
TOMCAT_HOME=/usr/local/tomcatx/tomcat7
CATALINA_HOME=/usr/local/tomcatx/tomcat7
CATALINA_BASE=/usr/local/tomcatx/tocat7
export  TOMCAT_HOME  CATALINA_HOME CATALINA_BASE

#添加的tocmat配置,可照此样添加多个tomcat

#tomcat71
TOMCAT_71_HOME=/usr/local/tomcatx/tomcat71
CATALINA_71_HOME=/usr/local/tomcatx/tomcat71
CATALINA_71_BASE=/usr/local/tomcatx/tocat71
export  TOMCAT_71_HOME  CATALINA_71_HOME CATALINA_71_BASE

2 修改tomcat71的bin/shutdown.sh,在exec "$PRGDIR"/"$EXECUTABLE" stop "$@"这行前边添加如下配置:

export JAVA_HOME=/usr/local/jdk1.6.0_23
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=$JAVA_HOME/lib
export CATALINA_HOME=$CATALINA_71_HOME
export CATALINA_BASE=$CATALINA_71_BASE

 

3 修改tomcat71的bin/startup.sh,在exec "$PRGDIR"/"$EXECUTABLE" stop "$@"这行前边添加如下配置:

export JAVA_HOME=/usr/local/jdk1.6.0_23
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=$JAVA_HOME/lib
export CATALINA_HOME=$CATALINA_71_HOME
export CATALINA_BASE=$CATALINA_71_BASE

 

4 修改tocmat6.0-2的conf/server.xml,更改端口

-----------------------------tocmat6.0-2的server.xml配置如下----------------

<?xml version='1.0' encoding='utf-8'?>
<Server port="9005 " shutdown="SHUTDOWN">

  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <Listener className="org.apache.catalina.core.JasperListener" />
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

  <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>

  <Service name="Catalina">
     
    <Connector port="9080 " protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" URIEncoding="UTF-8" maxHttpHeaderSize="8192" maxThreads="1000" enableLookups="false" compression="on" compressionMinSize="2048" compressableMimeType="text/html,text/xml,text/javascript,text/css,text/plain" disableUploadTimeout="true" useBodyEncodingForURI="true" />

    <Connector port="9009 " protocol="AJP/1.3" connectionTimeout="20000"
               redirectPort="8443" />

    <Engine name="Catalina" defaultHost="localhost">

      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>

      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
      </Host>
    </Engine>
  </Service>
</Server>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值