一台机器装两台tomcat

五、直接拷贝一份tomcat

#cp -r /usr/local/tomcat.6.0 /usr/local/tomcat6.0_1

 

六、进入第二份tomcat6.0_1的配置文件修改端口

#cd /usr/local/tomcat6.0_1

#vi conf/server.xml

8015" shutdown="SHUTDOWN">  //把8005改为8015

    8081" protocol="HTTP/1.1"    //把8080改为8081

               connectionTimeout="20000" 

               redirectPort="8443" />

七、添加环境变量

#vi /etc/profile  //末尾添加

TOMCAT_HOME_1=/usr/local/tomcat6.0_1

CATALINA_HOME_1=/usr/local/tomcat6.0_1

CATLINA_BASE_1=/usr/local/tomcat6.0_1

export TOMCAT_HOME_1  CATALINA_HOME_1  CATALINA_BASH_1

   #source /etc/profile    //重载配置文件使之立即生效

 

八、修改第二个tomcat6.0_1下的 catalina.sh(此处是重点)

     替换catalina.sh 中的变量CATALINA_HOME

      把CATALINA_HOME改为CATALINA_HOME_1(与环境变量修改的一致)

#cp /usr/local/tomcat6.0_1/bin/catalina.sh /usr/local/tomcat6.0_1/bin/catalina.sh.bak 

//备份一份

#sed 's/CATALINA_HOME/CATALINA_HOME_1/g' /usr/local/tomcat6.0_1/bin/catalina.sh  > catalina.sh_1

#cd /usr/local/tomcat6.0_1/bin

#mv catalina.sh_1 catalina.sh

#chmod a+x catalina.sh


你可能感兴趣的:(profile,local,protocol,配置文件)