views:

32

answers:

1

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 ? Can I just have one CATALINA_HOME and do away with CATALINA_BASE (or vice-versa) ?

A: 

I can't say I know the best practice, but here's my perspective.

Are you using these variables for anything?

Personally, I haven't needed to change neither, on Linux nor Windows, in environments varying from development to production. Unless you are doing something particular that relies on them, chances are you could leave them alone.

catalina.sh sets the variables that Tomcat needs to work out of the box. It also says that CATALINA_BASE is optional:

#   CATALINA_HOME   May point at your Catalina "build" directory.
#
#   CATALINA_BASE   (Optional) Base directory for resolving dynamic portions
#                   of a Catalina installation.  If not present, resolves to
#                   the same directory that CATALINA_HOME points to.

I'm pretty sure you'll find out whether or not your setup works when you start your server.

Lauri Lehtinen