Hello everyone,
I'm very new to Tomcat so pardon me if this is an easy question.
I *have* read the relevant documentation (several times) and that really just made matters worse. Sometimes the documentation seems a bit incomplete. I've tried several things the documentation says should work without success. Probably it's my lack of understanding.
As an aside, speaking of incomplete documentation, if you go to:
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/host.html" you will see there is a section entitled, "Automatic Application Deployment". The third bullet point has a link to "Default Context". This link does not work in the downloaded version of TC's documentation although it works fine in the online version. I guess somebody forgot something.
--------------
Let me explain what I want to do. I'm hoping someone could tell me where I'm going wrong, in a polite way. :)
I'm trying to use TC 5.5.9 on Win 2k.
I want the "document base" directory (the <Context>'s "docBase") for my default web application to be something other than ROOT. Please don't ask, "why?", this is a simplification of a different but equivalent problem.
When I start TC, CATALINA_BASE is set to "C:\MyConfigs". Here is what the initial underlying directory structure looks like:
C:\MyConfig\ +-conf\ | +-context.xml | +-server.xml | +-web.xml +-Sites\ | +-Test 1\ | | +-site\ | | | +-public_html\ | | | | +-ROOTXXX\ | | | | | +-index.html
I want my "docBase" to be "ROOTXXX" instead of "ROOT" (again, this is an over-simplification but illustrates the problem).
Here is my server.xml from the "conf" directory above:
<Server port="10035" shutdown="SHUTDOWN" debug="0">
<Service name="Catalina">
<Connector port="80" />
<Engine name="ENGINE_1" defaultHost="localhost">
<Host name="localhost" appBase="Sites\Test 1\site\public_html" />
</Engine>
</Service>
</Server>
Here is my context.xml from the "conf" directory above:
<Context path="" docBase="ROOTXXX" />
In the TC docs for <Context> (http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html), it lists four bullet points that describe different places you can put the "context.xml" file. I tried to follow each of these bullet points. For each bullet point I first used a context file named "context.xml" and then I tried "ROOT.xml". Here's what I saw:
Bullet 1: $CATALINA_HOME/conf/context.xml
-----------------------------------------
I placed "context.xml" in the "conf" directory. This is consistent with the directory structure shown above. Tomcat seemed to start just fine but when I browse to the default context (http://localhost) I get a blank page. I then renamed "context.xml" to "ROOT.xml". This had no effect. It still didn't work. According to the TC docs, it should work, right?
Bullet 2: $CATALINA_HOME/conf/[enginename]/[hostname]/context.xml.default
-------------------------------------------------------------------------
I placed "context.xml" in the directory "conf/ENGINE_1/localhost" and renamed "context.xml" to "context.xml.default", as per the documentation. This didn't work. I received a blank page again. I then renamed "context.xml.default" to "ROOT.xml" and it worked! Hmmm, why did it work? At least it's what I wanted. But why didn't "context.xml.default" work? The TC docs say it should.
Bullet 3: $CATALINA_HOME/conf/[enginename]/[hostname]/
------------------------------------------------------
I didn't really understand this option since it didn't tell me what to name the file, so I skipped this option.
Bullet 4: /META-INF/context.xml
-------------------------------
Another failure. I named the file "context.xml" and then I tried "ROOT.xml". Neither worked, despite the TC documentation claims.
So, I'm kind of at a loss. I was successful with Bullet 2 but only when I renamed "context.xml" to "ROOT.xml". None of the other attempts worked, despite what the TC documentation said. Maybe there's another doc I need to read. I don't know. It's just so confusing. Can someone tell me why only #2 worked and then only when I named the file ROOT.xml? Why didn't the Bullets 1 & 4 work and what does #3 even mean? It's very frustrating.
Thanks for looking at this.
Bob
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
