tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Separation of CATALINA_HOME and CATALINA_BASE
Date Mon, 03 Nov 2014 23:05:59 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Mark,

On 11/3/14 4:59 PM, Mark Eggers wrote:
> 1. Set up an unaltered Tomcat in one directory 2. Create a
> duplicate directory structure somewhere else - to whit:
> 
> CATALINA_BASE-+ +-bin +-conf +-lib +-logs +-temp +-webapps +-work

You don't need all of that, but you can create all that structure if
you'd like.

> 3. Copy tomcat-juli.jar from CATALINA_HOME/bin to
> CATALINA_BASE/bin

tomcat-juli.jar can still live in CATALINA_HOME/bin (unless is
something very specific to Netbeans deployments).

> 4. Copy all of the stuff from CATALINA_HOME/conf to
> CATALINA_BASE/conf

You don't need it all. Really, only server.xml is required.

> 5. Edit CATALINA_BASE/conf/server.xml a. change the Server port b.
> change HTTP/1.1 connector port c. change the HTTPS connector port
> or comment it out d. change the AJP connector port or comment it
> out 6. Edit tomcat-users.xml 7. Copy over the manager application 
> a. Copy over the application from CATALINA_HOME/webapps - OR - b.
> Create a manager.xml in CATALINA_BASE/conf/Catalina/[hostname]
> 
> <?xml version="1.0" encoding="UTF-8"?> <Context docBase="location
> of manager application in CATALINA_HOME" 
> antiResourceLocking="false" privileged="true" useHttpOnly="true"/>

I've started doing this:

  <Context
    docBase="${catalina.home}/webapps/manager"
    ...

Since I never deploy from CATALINA_HOME, I can always rely on the
manager sitting there in the webapps/ directory. Actually, in order to
avoid synchronization issues between package-managed manager.xml and
whatever ships with Tomcat, we just wrote an XSL transform that adds a
docBase to the stock
CATALINA_HOME/webapps/manager/WEB-INF/context.xml. So we keep
up-to-date with anything that gets changed in there from release to
release.

> To modify what extra JARs are needed for this CATALINA_BASE, just
> add them to CATALINA_BASE/lib. This way your pristine Tomcat
> remains pristine.

This is the one thing I haven't bothered to do yet for our
deployments. We need a JDBC driver and I usually just drop it into
CATALINA_HOME/lib and call it a day. Many times I've been bitten by
that when I install a new version of Tomcat and try to launch the
webapp, realizing that the JDBC driver wasn't in place.

We don't package-manage the driver and we don't use Maven or anything
like that to go auto-download dependencies or anything crazy like
that, so it's not currently a part of the application build process at
all.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJUWApXAAoJEBzwKT+lPKRYEXcP/jCCRuwIxpgt9XcfYrclr8BZ
xGzkqvh8am/Tp/xo980ZuDiLOBLYJdVl0vXmgm0HWHlidpFbqkGJZG8uIDgXDBQ4
qSQGu9InvdwNTgn0sx/tlED9tfS2XDIJno6GUYMetjfaqwmGQEDtsKKdy5ycbigz
xMC91NJEqSgLbcCRp3WOTXGIJPJB14GQtPHGbMU7iOpLXcbxAgE3Ld3Sl2DYzl+H
oafNVVaTglV8ENQbrtKN55bJzco38tEcgJ6IhNbTPZ6XsV/sdwSAzBvrvhmHzPja
uCmnnp/AN9qa+rJUiY+DL9obJef1VxU4PKZ6MtW9PawGlClbQaVGedr/6T7NthjH
ZbJoGVr85KM0cFTYIuys0a4k3u8If1eMoFWXo5jGssAzTfOA10jRyAjByelJbbbT
R+KcZ4PuVOslhXK1J80Di47SEJvMFwdafFUBBRNOBKhv18hB9eeaETacJjB5ChGj
uLk7rdOktoDKmErrvDv5BIw+AhVCTeCP6gwphUZ2sFl6sMan5l8crDOCcfmn+Yod
zhvCOVvhEXaOYW9kXvr3pu3wlxKUzIborxtFnmVlvQMXMeBfJ6XqfK/vmBqrZK2V
8zHnn+eYZ4T/ClTKNxYdfu4Q5pHe1EDTxHP50bTET7zHHqtc25XCZfTHrmQwJJB9
bcEbkdyqN7hzqrRftt33
=vA7W
-----END PGP SIGNATURE-----

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


Mime
View raw message