tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Setting up a Context outside of webapps
Date Fri, 21 Oct 2016 20:53:37 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Igal,

On 10/21/16 3:41 PM, Igal @ Lucee.org wrote:
> Chris,
> 
> On 10/21/2016 12:03 PM, Christopher Schultz wrote:
>> I'm not sure anyone else's opinion matters at this point. You've 
>> decided what you want to do... you're just looking for
>> validation. Technically, this works. Whether there are better
>> ways to do it are debatable.
> I've been running Tomcat for almost 10 years now, and this works
> for me well, having separate directory trees for software, config
> files, and web documents.
> 
> So yes, I've decided what I want to do.  But I want to make sure
> that there are no unintended consequences of which I'm unaware.

I don't believe there are any untended consequences of doing what
you're doing, other than the caveat that you have to bounce Tomcat to
make any changes.

>> But you're not interested in anyone else's opinon, so why bother
>> asking?
> That's because I'm not looking for an opinion of users who've found
> some config files online and copied/pasted them to their server.
> I'm looking for an opinion of someone who knows the inner workings
> of Tomcat, e.g. someone from the core team members.
> 
> So far no one has shown me how they set up Tomcat in a directory
> outside of $CATALINA_BASE.  The few "opinions" that I received say
> that my web directories should reside inside
> $CATALINA_BASE/webapps, which as you stated -- I've already decided
> that is not what I want.

If you want applications deployed outside of the appBase, then the
best way IMO is to drop your application.xml into
conf/[service]/[host]/[appname].xml. Point the docbase anywhere you
please.

>> How many different ways are there to demonstrate:
>> 
>> <Host> <Context /> </Host>
>> 
>> ??
> How exactly does that show how to specify where the web root will
> be, and have it outside of $CATALINA_BASE/webapps?

I'm sorry, that reference was for a few lines below what you're asking
here. This is the one you want, now:

http://tomcat.apache.org/tomcat-8.5-doc/config/context.html#Naming

It says pretty clearly: the docbase identifies where your files are,
and the name of the XML file defines the URL mount-point.

> My question, at least the 2nd time around, is in my opinion very
> clear and very valid.  It'd be really great if someone can provide
> a real answer rather than post a couple of links to the docs (I
> have access to google too), or tell me that I'm just "doing it
> wrong".

Okay: you're doing it wrong and instead you should do what I've
outlined above and is detailed in Tomcat's configuration reference:
put your application's XML file in conf/[service]/[host]/[appname].xml
and put your bite wherever the heck you want.

The only difference between what I'm recommending and what you are
doing is the location of the <Context>: I recommend a separate file,
and you like server.xml. They will both work. There are advantages to
each, and I suspect you know what they are. I happen to like the
advantages of my recommendation over your current deployment and I've
explained what those advantages are. If you don't think it's worth the
trouble, don't change anything.

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

iQIcBAEBCAAGBQJYCoBRAAoJEBzwKT+lPKRYxoUQAJoKQy/+XrIeEIWQpVQBCtOZ
JkLBKsme5GSXEYlnB/qhBWjnMeGbK5NP4Fq3XpMLnJzCPtEhNMuhsf0ONld2YPQN
XEN2s1lA+LedNbg83RrsXWXupR+G5rbx0LwxO8sdAl8qHkYMUad0DMTx54EPzBZB
CeeRSEa251Ty3owaw+DZNQrVN6GFKLf1HnM29KUghVSvjtk17W79Fq6nVsLEvmt4
oRtZ/Oc+k7dXB7EAqwQEi7sCHk/1qcCW8nnI52enrQMuFvp9obTj3z1AcZs2EbPI
RAr9FY5qoVp/GcV6Z0YyPkgTkNEBTkYbB/hgJq+ELbmVJ9WFKjSy+04f8yEhLM3T
rjD53UwguuTAL6uO3wfyrWIgLZM0at+oDdXSB2ieos0Sq++/Nd7MBcTkLhH1ljBr
zDNscvg7kVDU9UJ2WQeziGynST8vfJ8JySF1VYXjhqNS3O4dRtoP/EK63IrbXRJb
iruokzzMMm8lWoxtnl297VWUwcGcV6m3E/MQkRCxvuC76ndVwXbTL/kkLhKcz5AN
HkSvMxO0ZSwuKSYUAxA413a9w4Gys9R9TeOwtQrPB9LMzpMj4dlziGgTQNHWf5eE
8QRQA12SFGGSu3nqhyyueZgcrGUotS27exC7Cfv+6ggLGLjg+yIvRCWjFbcLphdm
cSyT7BSR+kGOkBO77wF5
=lhEp
-----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