$CATALINA_HOME/conf/Catalina/dummyapps/ROOT.xml
Where did you get that location for a <Context> element? It certainly didn't
come from the docs, nor from Peter's or my messages. Go back and reread them all.
To quote from Peter's message:
Yep, I had that wrong. I was getting the <Host> name and appBase confused.
create a file in $tomcathome/conf/Catalina/yourhost called ROOT.xml
The name of your <Host> is? (It's certainly not dummyapps.) Tomcat would have
completely ignored a file in the above location.
<Context>
<WatchedResource>WEB-INF/web.xml</WatchedResource>
</Context>
Does that look at all like the <Context> element Peter provided? To refresh
your memory, here it is again (with the invalid path attribute removed):
<Context docBase="$tomcathome/somewhereNotInTheAppbase/myapp.war"
reloadable="true">
Note the presence of the docBase attribute and the comment therein.
Also, it's pointless to have a <WatchedResource> of WEB-INF/web.xml in your <Context>
element, since that value is already in the global one. If you have nothing to put in a
<Context> element, you don't need one.
Removed. Now I realize the global nature of the context.xml file that lives in
/conf.
And the directory structure for the new context home (the content a
built/deployed app I copied over from its old location in /webapps).
$CATALINA_HOME/dummyapps
$CATALINA_HOME/dummyapps/WEB-INF
$CATALINA_HOME/dummyapps/index.jsp
$CATALINA_HOME/dummyapps/(other static files)
Which is still very wrong. The appBase directory is the default location for all of a <Host>'s
webapps - there can be many. The default webapp for a <Host> must be named ROOT (case
sensitive), and is located either under the <Host> appBase directory, or where the
<Context> docBase attribute points in the conf/Catalina/[host]/ROOT.xml file.
Peter's message shows one way to achieve what you want, and facilitates the use of the same .war
file or directory as the default one for each <Host> (the docBase attribute of all the
ROOT.xml files would point to the same place). If in fact you want to use a different default
webapp for each <Host>, you can separate them by the appBase setting of each <Host>,
and not place the ROOT.xml file in conf/Catalina/[host]. In this scenario, your structure would
be:
host1apps/ROOT/
host1apps/ROOT/WEB-INF/
host1apps/ROOT/WEB-INF/lib/
host1apps/ROOT/WEB-INF/classes/
host1apps/ROOT/WEB-INF/web.xml
host1apps/ROOT/META-INF/
host1apps/ROOT/META-INF/context.xml
host1apps/ROOT/index.jsp
host1apps/ROOT/<anything else needed>
I think this is what helped out the most. I never totally understood that I could use the ROOT context in this manner
(which is exactly what I was after).
Thanks for your helpful and detailed responses. Thanks to Peter and Hassan as
well. I have the virtual host working now!
Eric
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org