Christopher Schultz wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

André,

On 8/19/14, 7:06 PM, André Warnier wrote:
Christopher Schultz wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256

Shawn,

On 8/19/14, 2:31 PM, NEW IT wrote:
So you meant after I fired up the Tomcat 7 then change the environment variables for the version 6 and startup there too?
Yes, you can do that, but...

CATALINA_HOME could set to version 7 and CATALINA_BASE set to version 6 OK?
No, CATALINA_BASE has to agree with CATALINA_HOME's
configuration. So you can't for example create a setup under
/opt/tomcats/mywebapp/ and then launch with
CATALINA_BASE=/opt/tomcats/mywebapp/ under both Tomcat 6 and
Tomcat 7. The reason is that server.xml usually contains certain
things that are version-specific.

But, if you want to deply the same web application to Tomcat 6
and Tomcat 7, you could do something like this:

$ JAVA_HOME=/opt/java-7 $
CATALINA_HOME=/opt/apache-tomcat-7.0.55 $
CATALINA_BASE=/opt/tomcats/mywebapp-tc7/ $
CATALINA_HOME/startup.sh

$ JAVA_HOME=/opt/java-6 $
CATALINA_HOME=/opt/apache-tomcat-6.0.41 $
CATALINA_BASE=/opt/tomcats/mywebapp-tc6/ $
CATALINA_HOME/startup.sh

This will launch Tomcat 6 on Java 6 with your webapp configured
in mywebapp-tc6 and a similar setup with later versions for
mywebapp-tc7.

- -chris

On Tue, Aug 19, 2014 at 10:43 AM, Christopher Schultz <ch...@christopherschultz.net> wrote: To whom it may concern,

On 8/19/14, 1:32 PM, NEW IT wrote:
Besides setting for the 2 different ports, how do deal
with the Environment Variables of Path, CATALINA_HOME?
They are having the values for the 7 for now and
JAVA_HOME could be using the the same one for Tomcat 7
and 6?
You can do anything you want, here.

CATALINA_HOME specifies where the Tomcat installation is. CATALINA_BASE specifies where your "local" deployment goes:
this allows you to use a single CATALINA_HOME with multiple
Tomcat instances running with separate configurations (those
with different CATALINA_BASEs). JAVA_HOME specifies the JVM to
use.

You can set the above environment variables, launch Tomcat,
then set them to other values and launch another instance of
Tomcat. You can change your JVM, Tomcat version, etc. whenever
you want. Once the JVM is launched, that process is independent
of the shell you used to launch it.

On our development servers, we have multiple developers with multiple per-webapp JVMs running all off the same
CATALINA_HOME under different JVMs. All you have to worry about
is the port settings in each CATALINA_BASE/conf/server.xml.

Hope that helps, -chris

The subject says "on the same pc". Now that is not a guarantee that
we are talking about Windows here, but at least a strong
suspicion. In such a case, there is the question of whether this
relates to running Tomcat as a Windows Service, or in a command
window, or both. So this may all be a bit more complicated than
meets the eye.

While that may be true, that's an implementation detail (e.g. Windows
Service versus Debian Linux package-maintained service, etc.). The
point is that Tomcat can in fat be run side-by-side on the same
machine: the mechanisms exist to do so... you may have to work a bit
to get it working with your deployment strategy.


I understand that. What I meant is that the OP may need some guidance as to what parameters / environment variables / system variables etc.. are used when running as a Windows Service, or in a Windows command window e.g. For example, if running Tomcat in a command window, then the file bin/setenv.bat would be run if it exists. But when running as a Service, it won't. (Neither do I know how you would have to set CATALINA_HOME e.g., if you have 2 different Tomcats running as Services; neither in fact whether it matters in that case).


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to