tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Setting up a Context outside of webapps
Date Fri, 21 Oct 2016 20:53:37 GMT
Hash: SHA256


On 10/21/16 3:41 PM, Igal @ 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

>> 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:

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
Comment: GPGTools -
Comment: Using GnuPG with Thunderbird -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message