You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ch...@emc.com on 2012/05/25 21:31:28 UTC
CATALINA_BASE and CATALINA_HOME deployment
I'm trying to convert my app to use the preferred catalina base and home deployment. I understand that this allows for easier migration between tomcat versions, etc. As a point of reference, I'm reading about how to do this in Tomcat: The Definitive Guide. Also, I'm dealing with 5.5.35, if that matters.
I have one question. I understand that the separation of the core tomcat stuff from my instance stuff is good. But the book says to copy the entire conf folder over to my instance folder ( CATALINA_BASE/myapp/conf ). Isn't this copying a bunch of tomcat version specific stuff that I'll have to sift through when it's time to migrate? Will I be able to just upgrade CATALINA_HOME and not upgrade all of that copied conf stuff as well?
Thanks,
Chad
Re: CATALINA_BASE and CATALINA_HOME deployment
Posted by André Warnier <aw...@ice-sa.com>.
Chad.Davis@emc.com wrote:
> I'm trying to convert my app to use the preferred catalina base and home deployment. I understand that this allows for easier migration between tomcat versions, etc.
Maybe that is a slight misconception. I think that the separation between catalina_base
and catalina_home is /mainly/ directed at allowing someone to run multiple tomcat
instances on the same host, with different configurations, but sharing the same (tomcat) code.
As a point of reference, I'm reading about how to do this in Tomcat: The Definitive Guide.
That may be ok, but why not use the online tomcat documentation ?
Last time I looked - and with the exception of the part about logging ;-) - it was quite
comprehensible.
Also, I'm dealing with 5.5.35, if that matters.
Well yes. Why choose an old version that will soon become obsolete (or at least unsupported) ?
The current version is 7.0, and the version before that was 6.0.
If you are going to make this effort, do it with the latest released version. It will last
longer.
>
> I have one question. I understand that the separation of the core tomcat stuff from my instance stuff is good.
But the book says to copy the entire conf folder over to my instance folder (
CATALINA_BASE/myapp/conf ).
That's a strange-sounding location.
Maybe you are confused about the term "instance" ? It means "an instance of tomcat", not
of your application.
The correct folder is catalina_base/conf.
The default location for applications running under that separate tomcat instance would be
catalina_base/webapps/, with your apps below that one (like catalina_base/webapps/myapp).
Isn't this copying a bunch of tomcat version specific stuff that I'll have to sift through
when it's time to migrate?
Will I be able to just upgrade CATALINA_HOME and not upgrade all of that copied conf
stuff as well?
>
Definitely not. The files in the "conf" folder are quite likely to change between
versions (old tags being retired, new tags being added, attributes changing in tags, etc..).
The recommended practice when you ugrade to another version is to install a "vanilla" new
version in a new directory, with the vanilla conf files of that new version.
Then check that it is working.
And then, bring over your modifications to the old vanilla version, into these new conf
files, one by one and carefully, consulting the docs at every step to see what's changed.
Then when it all works with the new version, remove the old one.
Under the catalina_home/catalina_base directory (by default they are the same), there have
been (and will be) changes between versions, such as some sub-directories disappearing or
being renamed, other ones added, and some stuff that used to be in one place being moved
to another. If you try to keep the same directory structure and the same conf files
between versions, you are looking for trouble.
Note: I am talking about upgrading between major versions, like from tomcat 5.5.x to
tomcat 6.0.x, or from 6.0.x to 7.0.x.
If you are talking about upgrading from 7.0.x to 7.0.y, then things are a bit different.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: CATALINA_BASE and CATALINA_HOME deployment
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Chad,
On 5/25/12 3:31 PM, Chad.Davis@emc.com wrote:
> I'm trying to convert my app to use the preferred catalina base
> and home deployment.
I dunno about /preferred/, but it certainly is flexible.
> I understand that this allows for easier migration between tomcat
> versions, etc.
Absolutely!
> As a point of reference, I'm reading about how to do this in
> Tomcat: The Definitive Guide. Also, I'm dealing with 5.5.35, if
> that matters.
CATALINA_BASE and CATALINA_HOME have worked (roughly) the same way
since at least as far back as Tomcat 4.1.
> I have one question. I understand that the separation of the core
> tomcat stuff from my instance stuff is good. But the book says to
> copy the entire conf folder over to my instance folder (
> CATALINA_BASE/myapp/conf ). Isn't this copying a bunch of tomcat
> version specific stuff that I'll have to sift through when it's
> time to migrate?
Yes and no. First, you *must* have a separate conf/server.xml file
otherwise all your instances will conflict with their port numbers,
etc. Same thing with conf/tomcat-users.xml -- that would be a security
issue to share that configuration.
Technically, you can leave catalina.policy, catalina.properties,
context.xml, and logging.properties in CATALINA_HOME/conf and Tomcat
will pick them up.
You'll have to check, but you may be able to leave web.xml out of
CATALINA_BASE/conf and Tomcat will pick-up the one from
CATALINA_HOME/conf.
> Will I be able to just upgrade CATALINA_HOME and not upgrade all of
> that copied conf stuff as well?
When upgrading between major versions of Tomcat (say, 5.5 -> 7.0 which
you should do at your earliest possible convenience), you *will* have
to ditch your server.xml. You will also have to replace your
conf/web.xml file with the one that comes with the version of Tomcat
that you are using. I think everything else left over (assuming you
have left out catalina.policy, etc. as I described above) then you
should be good to go after a new server.xml has been installed.
When I upgrade from one version to the next, I usually just do a diff
of my server.xml and the one that is in CATALINA_HOME/conf of the
version I'm /leaving/. Then, I get a fresh copy of server.xml from the
*new* version of Tomcat, stick it in CATALINA_BASE/conf/ and apply
basically the same changes to it. That way, I don't break things like
logging, standard Listener configuration, etc.
Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk+/670ACgkQ9CaO5/Lv0PD/GgCeLsr3wzQr0UOTUWphWCATwLFY
gPgAoI2GZIcAqUR88oVPfJfM9ZvCV33E
=x70f
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org