Search code examples
javatomcatenvironment-variables

Tomcat - CATALINA_BASE and CATALINA_HOME variables


I have multiple instances of tomcat 6 running on the same server (Linux) and it works as expected. I am trying to find out what the standard practice is with regards to setting the CATALINA_HOME and CATALINA_BASE variables.

In my tomcat installation, I have setup CATALINA_HOME to point to a "common" folder (say /tomcat6) and the CATALINA_BASE variable varies depending on the instance name (say /tomcat_instance1, /tomcat_instance2)

My question is this:

  • Do I really need two variables?
  • Or Can I just have one CATALINA_HOME and do away with CATALINA_BASE (or vice-versa) ?

Solution

  • If you are running multiple instances of Tomcat on a single host you should set

    • CATALINA_BASE to be equal to the .../tomcat_instance1 or .../tomcat_instance2 directory as appropriate for each instance and the
    • CATALINA_HOME environment variable to the common Tomcat installation whose files will be shared between the two instances.

    The CATALINA_BASE environment is optional if you are running a single Tomcat instance on the host and will default to CATALINA_HOME in that case. If you are running multiple instances as you are it should be provided.

    There is a pretty good description of this setup in the RUNNING.txt file in the root of the Apache Tomcat distribution under the heading Advanced Configuration - Multiple Tomcat Instances

    See also the documentation of Apache Tomcat 10/Introduction/CATALINA_HOME and CATALINA_BASE.