Monday, April 25, 2011

[Level 2] How to create multi instances of tomcat.

If you want to create multi instances of tomcat,
you can follow the below steps:
1. Copy logs, conf and webapps from origianl tomcat foler to a new location.
# mkdir -p [a new folder you like]
# cd [original tomcat folder]
# cp ./logs ./conf ./webapps [a new folder you like]
2. Set environment variables "CATALINA_BASE" to the above path.
# export CATALINA_BASE=[a new folder you like]
3. Startup tomcat.
# [original tomcat folder]/bin/startup.sh

And what's the difference between CATALINA_BASE and CATALINA_HOME,
the decision path is as below:
1. Decide CATALINA_BASE:
If you have CATALINA_BASE, the base directory is CATALINA_BASE,
if not, the real path of binary would be the CATALINA_BASE.
2. Decide CATALINA_HOME:
If you have CATALINA_HOME, the webapps base directory is in CATALINA_HOME,
if not, the CATALINA_BASE would be the CATALINA_HOME.

Wish this helps.

regards,
Stanley Huang