CATALINA_HOME
vs CATALINA_BASE
If you're running multiple instances, then 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 may be configured for multiple instances by defining $CATALINA_BASE
for each instance. If multiple instances are not configured, $CATALINA_BASE
is the same as $CATALINA_HOME
.
See: Apache Tomcat 7 - Introduction
Running with separate CATALINA_HOME
and CATALINA_BASE
is documented in RUNNING.txt which say:
The CATALINA_HOME
and CATALINA_BASE
environment variables are used to
specify the location of Apache Tomcat and the location of its active
configuration, respectively.
You cannot configure CATALINA_HOME
and CATALINA_BASE
variables in the
setenv
script, because they are used to find that file.
For example:
(4.1) Tomcat can be started by executing 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 circumstances, it is desirable to have a single copy of a
Tomcat binary distribution shared among multiple users on the same
server. To make this possible, you can set the CATALINA_BASE
environment variable to the directory that contains the files for your
'personal' Tomcat instance.
When running with a separate CATALINA_HOME
and CATALINA_BASE
, the
files and directories are split as following:
In CATALINA_BASE
:
bin
- Only: setenv.sh (*nix) or setenv.bat (Windows), tomcat-juli.jar
conf
- Server configuration files (including server.xml)
lib
- Libraries and classes, as explained below
logs
- Log and output files
webapps
- Automatically loaded web applications
work
- Temporary working directories for web applications
temp
- Directory used by the JVM for temporary files>
In CATALINA_HOME
:
bin
- Startup and shutdown scripts
lib
- Libraries and classes, as explained below
endorsed
- Libraries that override standard "Endorsed Standards". By default it's absent.
How to check
The easiest way to check what's your CATALINA_BASE
and CATALINA_HOME
is 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 may also check where the Tomcat files are installed, by dpkg
tool as below (Debian/Ubuntu):
dpkg -L tomcat7-common
$CATALINA_HOME
) from maintenance of the Tomcat instance configuration and contents (which live in$CATALINA_BASE
). – Sudorific