Difference between Tomcat_CATALINA_BASE and CATALINA_HOME

via: http://blog.csdn.net/keda8997110/article/details/21400455

 

In the end, what is the difference between CATALINA_HOME and CATALINA_BASE? Before, I installed a tomcat on the server because it was a little trick. Then, according to the configuration of the predecessors, the two values ​​of CATALINA_HOME and CATALINA_BASE were set to the tomcat directory (actually here The description is very imprecise), I accidentally saw the company's installation documentation today, which mentioned the configuration of running multiple tomcat instances, and then I figured out what the difference between the two is.

 

We can find the answer from the Tomcat 5.5 configuration documentation (http://tomcat.apache.org/tomcat-5.5-doc/config/host.html):

 

The description below uses the variable name $CATALINA_HOME to refer to the directory into which you have installed Tomcat 5, and is the base directory against which most relative paths are resolved. However, if you have configured Tomcat 5 for multiple instances by setting a CATALINA_BASE directory, you should use $CATALINA_BASE instead of $CATALINA_HOME for each of these references.

 

From this description, you can see the difference between CATALINA_HOME and CATALINA_BASE. Simply put, CATALINA_HOME is the installation directory of Tomcat, and CATALINA_BASE is the working directory of Tomcat. If we want to run multiple instances of Tomcat, but don't want to install multiple copies of the Tomcat software. Then we can configure multiple working directories, each running instance has an exclusive working directory, but shares the same installation directory.

 

 

 

Each running instance of Tomcat needs to use its own conf, logs, temp, webapps, work and shared directories, so CATALINA_BASE points to these directories. The other directories mainly include Tomcat binary files and scripts, and CATALINA_HOME points to these directories.

 

If we want to run another Tomcat instance, then we can create a directory, copy conf, logs, temp, webapps, work and shared to this directory, and then let CATALINA_BASE point to this directory.

 

On one server, you can run multiple tomcat instances without installing multiple tomcats. You can use different users. Take the test user as an example, copy the /usr/local/apache-tomcat-6.0.18 directory to /home/ Under test, delete the /home/test/apache-tomcat-6.0.18/bin subdirectory (this directory is not required), edit the /home/test/.bash_profile file, and set CATALINA_HOME to point to the previous installation directory /usr/local/apache -tomcat-6.0.18, set JAVA_HOME to point to the installation directory /usr/java/jdk1.6.0_11 just now. Set CATALINA_BASE to point to /home/test/apache-tomcat-6.0.18, set CATALINA_OPTS to be the same as /root/.bash_profile (jmx management port uses a different port number)

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326993542&siteId=291194637