> I understand what the appBase is
>
> Perhaps you don't; the appBase attribute of a <Host> is the /default/
> deployment directory for its webapps; individual webapps are typically
> located *under* the appBase directory.
>
> > I don't understand why the docBase and appBase cannot be the
> > same declaration
>
> Because they are quite different; appBase points to the directory under
> which a *collection* of webapps resides, docBase points to an *individual*
> webapp.


*I kind of figured that one, that the appBase is where the collection of
deployable packages resides.*

> why it is recommended that anything in your appBase shouldn't
> start with the same string that is defined in your docBase.

I haven't read the O'Reilly book so I don't know if it contains confusing or
> irrelevant information.  The real point here is that you can easily get
> double deployments if you start putting in values for docBase; it's normally
> not used these days.


*This isn't in the O'Reilly book, I found this in multiple places on the
net, it was coupled with the double deployment information.*

>
> > I have my docBase set to ROOT on the data drive
> > and the appBase is just defined as <drive>:/webapps/
>
> You seem not to be aware that one can have many webapps running under one
> instance of Tomcat; ROOT is simply the default one.  Note that if your
> <Context> element is in your webapp's META-INF/context.xml file, it is
> illegal to set the docBase (or path) attributes.  The docBase attribute
> should only be used when the webapp is located *outside* of the <Host>
> appBase directory, and the <Context> element is in
> conf/Catalina/[host]/[appName].xml.


*Wait a sec, illegal as in (will throw an exception) or just bad practice? I
understand the idea of each <Host> can have it's own different appBase
declaration.  This cleared up the issue of "when" the docBase attribute
should be set, but my conf/Catalina/[host]/[appName.xml] doesn't exist.  I
have a <context> defined in my server.xml's <host> for the deployments being
hosted outside of $CATALINA_HOME/webapps directory, and each of those has
their own context.xml defined in the META-INF directory of the project.  Are
you saying that, that is wrong?  I'll post the xml configurations if you
want to look at it, but if it is wrong, it's working like expected.
*

>
> > there is really no clear concise "This is what the docBase is,
> > does, and means" that I can find.
>
> To quote from the Tomcat doc:
>
> "The Document Base (also known as the Context Root) directory for this web
> application, or the pathname to the web application archive file (if this
> web application is being executed directly from the WAR file). You may
> specify an absolute pathname for this directory or WAR file, or a pathname
> that is relative to the appBase directory of the owning Host.
>

*I'm sorry if I am being thick.... this is very cryptic to me.*

>
>
> "The value of this field must not be set when the Context is configured
> using a META-INF/context.xml file as it will be inferred by the automatic
> deployment process."
>
>  - Chuck
>

*As usual Chuck, thanks for taking the time and trying to explain things for
me.  From what I am seeing tomcat isn't that bad, it just can be a little
more than tricky to configure, and you can get some really interesting
errors when things aren't configured properly.

- Josh
*

Reply via email to