tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Documentation for Catalina Base
Date Tue, 31 Jul 2018 13:34:19 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Stefan,

On 7/31/18 4:24 AM, Stefan Mayr wrote:
> Hi,
> 
> Am 30.07.2018 um 18:25 schrieb Christopher Schultz:
>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
>> 
>> Marek,
>> 
>> On 7/30/18 3:22 AM, Marek Czernek wrote:
>>> Hi there,
>>> 
>>> recently, we noticed the lack of documentation for Catalina
>>> Base, and I wanted to find out more about it. Other than a
>>> strangely obscure txt file [1], I did not find the concept and
>>> usage of Catalina Base documented in the Tomcat docs.
>> 
>> Do you mean the CATALINA_BASE environment variable, which is
>> copied into a running JVM as the "catalina.base" system
>> property?
>> 
>>> My questions are:
>>> 
>>> 1) Did I overlook it being documented somewhere?
>> 
>> Other than in RUNNING.txt (where it is thoroughly described), it
>> is documented in:
>> 
>> 1. bin/catalina.sh and bin/catalina.bat 2. The "Directories and
>> Files" section of each Tomcat X documentation (e.g. 
>> https://tomcat.apache.org/tomcat-9.0-doc/introduction.html#Directorie
s_a
>>
>> 
nd_Files)
>> 3. The "Introduction" section of each Tomcat X configuration
>> guide for the "context" container (e.g. 
>> https://tomcat.apache.org/tomcat-9.0-doc/config/context.html#Introduc
tio
>>
>> 
n)
>> 
>>> 2) If not, is there any reason for it not being documented?
>>> While I don't want to duplicate text, I do not consider a txt
>>> file somewhere a sufficient docs.
>> 
>> What, it needs to be in TeX, too?
>> 
>>> If the answer to both of my questions is no, we'll create a
>>> patch against the Tomcat docs.
>>> 
>>> [1] https://tomcat.apache.org/tomcat-9.0-doc/RUNNING.txt
>> 
>> Patches are always welcome, but I believe it is currently 
>> properly-documented.
>> 
>> Is there something specific you were looking for and could not
>> find?
> 
> That's the point to ask for some details I'm struggeling with
> 
> 1. $CATALINA_BASE/bin/tomcat-juli.jar: when do I need to place this
> jar in this directory? It is only clear to have it in CATALINA_BASE
> for the documented switch to log4j. From reading catalina.sh I
> would say it is only necessary to place it in CATALINA_BASE when we
> want to use a different version. Is this assumption correct?

That file should generally be in CATALINA_HOME/bin and should match
the version of Tomcat is shipped with. If you want to use log4j for
logging, I would *always* place the replacement JULI implementation
into CATALINA_BASE/lib and leave the Tomcat "stock" installation alone.

> 2. $CATALINA_BASE/conf: What files have to be in this directory?

server.xml
web.xml (though I have argued that this should inherit from CATALINA_HOM
E)

There are other things that you might want to add, depending upon your
needs.

> If they are not present - are they loaded from CATALINA_HOME? 
> RUNNING.txt only mentions server.xml. But it looks like we need to 
> have at least a copy of web.xml in this directory too.
Yes, this is true:
https://bz.apache.org/bugzilla/show_bug.cgi?id=61877

> Reading catalina.sh we also should copy (or link) catalina.policy
> when running with a security manager.

Correct.

> For other files the situation is not clear, e.g. 
> catalina.properties, context.xml
Both catalina.properties and context.xml will fall-back to
CATALINA_HOME if they don't exist in CATALINA_BASE.

You may also want to put a static-user file e.g. tomcat-users.xml into
your CATALINA_BASE/conf directory. All paths in server.xml are
relative to CATALINA_BASE, so if you e.g. configure a <Resource> like
this:

    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"

factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />

Then conf/tomcat-users.xml will be found in CATALINA_BASE. Of course,
you can always use an absolute path and put it anywhere you want... it
doesn't have to be in that location, though many people will expect it
to be there if it's being used.

> ... Some stackoverflow answers to that question recommend to copy
> the whole conf directory from CATALINA_HOME to CATALINA_BASE. I'm
> not sure if this is a good idea if I don't need to change the 
> defaults. The documentation could be improved by listing the files
> that are mandatory in CATALINA_BASE

+1

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAltgZVoACgkQHPApP6U8
pFgxjhAAlMCi5kCjPx9ENkgNu1ifBQ5ziI/Jl+76G2tjMgH4wWxXqAG3FONchNBT
5wztEvyHTmkwS13o3z+8/3liaHSY6NSsVKyfNAR6QQA44mDOTEgpwAdPMYDl1doo
WKTOjbm59jrPIAk1Fo5P3cyodzWBHU0G2R+EMlExZ/cHJ7LezDHZ+i8b6dKAsBSl
qlahYEZvDFbGCEkPAtl5LkshKkfu/ZCoJwPZecHlv9R/DVUs7uutSVL0ubmwLf7e
gv++zf5g8UOxRI3za8VnurM+Wjt0vxzizqh7krAQkz51MZaN+Vt6mzO4wAWb9KNr
vSKu0Xu/U/8dfPIUZ5BskAU6hXQ9zZptcQiiTUUDNCVdtoI0zjqwfMHRJ89wZgAr
E3yBoi4rYZ+JSRJxjSAXrOhRYKwVXFKHsTbjJbxWn3CCppvnasU2eOxCl7b/aJwQ
qbZotXjJwkvWwLus1qmfVbv/h6Ju/4VVjdqn00pQmxCkOGjNUa+YrNPsL8v6t+sk
Ner1S+trNcr2jZgHEgODiRwpM3l6fT9PYi8jLjT1cbd+6U+w8Y1rBt4/EURpF+tA
c4x26NnATHeXOmT8EjYxyC7v2IB0/LyNiB23c5YsExpOxEQNvC5K0uIXkdkAHIqt
uTKDtx5XDU1c+JUjWgk8uTX2NFandWVWWk9J7pt1HyxvKiQhaKk=
=lf9I
-----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