1, under/usr/local two Tomcat,tomcat folder renamed as: Tomcat, TOMCAT1
2, modify the Linux profile file path/etc, the contents are as follows:
Add the following in profile:
Export java_home=/usr/java/jdk1.7.0_67
Export classpath=.; $JAVA _home/lib/tools.jar; $JAVA _home/lib; $JAVA _home/bin
#tomcat
Export Catalina_base=/usr/local/tomcat
Export Catalina_home=/usr/local/tomcat
#tomcat1
Export CATALINA_2_BASE=/USR/LOCAL/TOMCAT1
Export CATALINA_2_HOME=/USR/LOCAL/TOMCAT1
Export Tomcat_home=/usr/local/tomcat
Export TOMCAT_2_HOME=/USR/LOCAL/TOMCAT1
3. Modify the Tomcat configuration file
The tomcat6-1 configuration file remains unchanged;
The tomcat6-2 configuration file is modified as follows:
Modify files under Tomcat6-2/bin: Startup.sh and shutdown.sh (as added), add the following to the file: (or in Catalina.bat) (Note: Add to the first few lines of the file, otherwise the runtime will use the default configuration)
Export java_home=/usr/java/jdk1.7.0_67
Export path= $PATH: $JAVA _home/bin
Export classpath=.: $JAVA _home/lib/tools.jar: $JAVA _home/lib: $JAVA _home/bin
Export Catalina_home= $CATALINA _2_home
Export catalina_base= $CATALINA _2_base
Modify the Service.xml file under Tomcat6-2/conf, modify (three places) as follows:
1.<server port= "8005" shutdown= "Shutdown" >
8005 Change to 8006 (other unused ports can also)
2. <connector port= "8080" protocol= "http/1.1"
connectiontimeout= "20000"
redirectport= "8443"/>
8080 Change to 8081 (other unused ports can also)
3.<connector port= "8009" protocol= "ajp/1.3" redirectport= "8443"/>
8009 Change to 8010 (other unused ports can also)
4, after the modification, execute source/etc/profile or restart Linux
5. Start two tomcat:
sh/usr/local/tomcat/bin/startup.sh
sh/usr/local/tomcat1/bin/startup.sh
6. Access address: http://192.168.0.13:8080 and http://192.168.0.13:8081
The log file locations for 7, two Tomcat are as follows:
Under the Logs folder in the Tomcat directory
$TOMCAT _home/logs
/usr/local/tomcat/logs/
/usr/local/tomcat1/logs/
-------------------------------------------------------------------------------
Related references:
Linux Configuring multiple Tomcat
Http://jingyan.baidu.com/article/e9fb46e171a9757521f766db.html
Linux Configuring multiple Tomcat (two configuration)
Http://www.360doc.com/content/14/0614/15/203871_386547712.shtml
Deploying multiple Tomcat under Linux
http://blog.csdn.net/loadrunn/article/details/6579639
Linux Configuring multiple Tomcat