CATALINA_HOME vs CATALINA_BASE
If you use multiple instances, you need both variables, otherwise only CATALINA_HOME .
In other words: CATALINA_HOME is required, and CATALINA_BASE is optional.
CATALINA_HOME represents the root of your Tomcat installation.
Optionally, Tomcat can be configured for multiple instances by defining $CATALINA_BASE for each instance. If multiple instances are not configured, $CATALINA_BASE same as $CATALINA_HOME .
See: Apache Tomcat 7 - Introduction
Work with individual CATALINA_HOME and CATALINA_BASE documented in the RUNNING.txt file, which states:
The CATALINA_HOME and CATALINA_BASE environment CATALINA_HOME CATALINA_BASE used to specify the location of Apache Tomcat and the location of its active configuration, respectively.
You cannot configure the CATALINA_HOME and CATALINA_BASE in setenv script because they are used to find this file.
For example:
(4.1) Tomcat can be started by doing one of the following: commands:
%CATALINA_HOME%\bin\startup.bat (Windows) $CATALINA_HOME/bin/startup.sh (Unix)
or
%CATALINA_HOME%\bin\catalina.bat start (Windows) $CATALINA_HOME/bin/catalina.sh start (Unix)
Multiple Tomcat Instances
In many cases, it is desirable to have one copy of Tomcat Binary Distribution shared by several users on the same server. To make this possible, you can set the CATALINA_BASE environment variable to a directory containing the files for your "personal" instance of Tomcat.
When working with individual CATALINA_HOME and CATALINA_BASE , files and directories are separated as follows:
In CATALINA_BASE :
bin - Only: setenv.sh (* nix) or setenv.bat (Windows), tomcat-juli.jarconf - Server configuration files (including server.xml)lib - Libraries and classes as described belowlogs - Log and output fileswebapps - Automatically downloaded web applicationswork - Temporary working directories for web applicationstemp - The directory used by the JVM for temporary files>
In CATALINA_HOME :
bin - startup and shutdown scriptslib - Libraries and classes as described belowendorsed - libraries that override the standard "approved standards". By default, it is absent.
How to check
The easiest way to verify that you are doing CATALINA_BASE and CATALINA_HOME by running startup.sh , for example:
$ /usr/share/tomcat7/bin/startup.sh Using CATALINA_BASE: /usr/share/tomcat7 Using CATALINA_HOME: /usr/share/tomcat7
You can also check where Tomcat files are installed using the dpkg tool as shown below (Debian / Ubuntu):
dpkg -L tomcat7-common