tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: Multiple Time Zones on one Tomcat instance?
Date Wed, 01 Oct 2008 07:37:52 GMT
John Gardner wrote:
> Caldarale, Charles R wrote:
>>> From: John Gardner []
>>> Subject: Multiple Time Zones on one Tomcat instance?
>>> Is there any way we can serve mutliple webapps from a single Tomcat
>>> instance, with mutliple timezones?
>> Tomcat itself doesn't care about time zones, and a single JVM instance will only
use one time zone at a time (no pun intended).  You could run two instances of Tomcat, one
for the French, and one for the less picky rest of the world.  Other than that, you'd have
to make the adjustments in the webapp itself to be cognizant of each client's time preference.
> Thanks Charles
> So, using two instances of Tomcat on a single host OS would also involve
> installing two JVMs and each Tomcat instance using a different JVM?
> Would this be easy to do?  I was always under the impression that you
> could only ever have one Tomcat running per machine at any one time due
> to the CATALINA_HOME env variable getting confused as to which instance
> of Tomcat it is actually using?
I think there is a bit of confusion between "installation/installed" and 
To express it in lay words :

Terms like "installation directory", CATALINA_HOME, JAVA_HOME relate to 
the disk directory where that piece of software's *files* are installed. 
  For example, for Tomcat, CATALINA_HOME might be /usr/share/tomcat5.5 
or C:/Tomcat5.5.
Under that directory, you would find subdirectories like "bin" or 
"common" (where the actual Tomcat program files are located).

On the other hand, nothing stops you from running several "instances" of 
these programs simultaneously, in parallel, each instance having its own 
separate "run directory" and parameters.
This "run directory" for Tomcat is known as CATALINA_BASE.

You could for instance start two separate instances of Tomcat, which 
would both use the program files located in CATALINA_HOME/bin, but 
listen on different ports and use a different set of webapps.
In that case, the CATALINA_HOME of each instance would still be the same 
(allowing them to find the programs to run), but their *CATALINA_BASE* 
would be set differently; each of these Tomcat instances would look for 
its own configuration files in CATALINA_BASE/conf and, by default, each 
one would look in its own CATALINA_BASE/webapps directory for its webapps.

By default, there is only one instance of Tomcat running, and 
CATALINA_BASE is, by default, the same as CATALINA_HOME.
But that ain't necessarily so.

The same happens with the JVM : you only need to install it once, no 
matter how many separate instances you want to run.  You should just 
make sure that you start each instance with its own appropriate set of 
parameters. In the case of the JVM, this is not done via environment 
values such as CATALINA_HOME and CATALINA_BASE, but usually via "-D" 
options on the java command-line.

Hope this helps.

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message