tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan Burlison" <>
Subject Re: Changing defaultHost from localhost to a FQDN
Date Sun, 29 Oct 2006 10:36:40 GMT
On 27/10/06, Caldarale, Charles R <> wrote:

> The 5.0 and 5.5 docs are mild upgrades of the 4.1 versions, and some
> areas did not get revised as much as they should have.  5.5 especially
> seems to be stricter on use of unnecessary attributes when the <Context>
> element is not in server.xml; what I posted has been gleaned from
> experience.

Thanks ;-)

> For compatibility, you can still place <Context> elements in server.xml,
> but it's strongly discouraged, since it requires a Tomcat restart to
> make any changes.
> > So how *should* I do what I want, i.e. deploy the app in a directory
> > called meshcms under webapps, or am I forced to name it ROOT if I want
> > it to be the default application?
> The current philosophy is that the default app must be named ROOT.

Ah, that's not entirely clear from the docs.  I can live with that, my
initianl assumption (wrong) was that the name didn't actually matter.

> There are three ways to achieve this:
> 1) Deploy the app in the ROOT subdirectory of the <Host>'s appBase
> directory, removing any ROOT.war file if it exists.
> 2) Deploy the packaged app as ROOT.war in the <Host>'s appBase
> directory, removing the ROOT subdirectory if it exists.
> 3) Deploy the app outside of the <Host>'s appBase directory, and place a
> ROOT.xml file in conf/[engine]/[host].  The ROOT.xml file must contain a
> <Context> element with a docBase attribute pointing to the location of
> the app.
> Note that in the first two cases, you often do not need any <Context>
> element for the app.  If you do require one (e.g., to configure the app
> as privileged), place the element and attributes in META-INF/context.xml
> inside the app directory structure.  Alternatively, you may place the
> <Context> element in conf/[engine]/[host]/[appname].xml, but without the
> docBase attribute.
> If you place a <Context> element with a docBase attribute in
> conf/[engine]/[host]/[somefile].xml and put the app under the <Host>'s
> appBase directory using a name other than [somefile], you will get the
> app deployed twice - once as the .xml file name, once as the
> subdirectory or .war file name under appBase.

That's an excellent, clear, summary - I haven't been able to find
anything else that explains the three cases you outline above.
Hopefully it might make its way into the official documentation at
some point ;-)

Many thanks!

Alan Burlison

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message