Web Hosting Talk







View Full Version : tomcat context path


Panzerfaust
02-11-2002, 11:07 PM
Can anyone please tell me what the path for "Context path" should be? I have web.xml in the WEB-INF directory, but for some reason it's not being loaded. The docBase is /public_html

ckpeter
02-12-2002, 05:07 PM
Note that I haven't check the doc yet, so I could be wrong...

the context path is http://www.yourdomain.com/context_path

Experts, please correct me if I am wrong.

Peter

bitserve
02-12-2002, 10:40 PM
It depends on where you're entering it at, and how you want the context defined. I'd suggest looking at the example config files that come with it, and reading the comments in them.

What version of Tomcat are you using? I'm guessing you're integrating it with apache? Show us your httpd.conf virtual host entry, if there is one, and your server.xml.

But in most cases, I'd think that you'd want it blank.

Jedito
02-13-2002, 12:31 AM
This is how it look more o less my server.xml

<Host name="[hostname]" debug="0" appBase="webapps" unpackWARs="true">
<Valve className="org.apache.catalina.authenticator.SingleSignOn"
debug="0"/>
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="[hostname]_access_log." suffix=".txt"
pattern="common"/>
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="[hostname]_log." suffix=".txt"
timestamp="true"/>
<Context path="[context]" docBase="/home/[user]/path/to/context" debug="0"
reloadable="true">
</Host>

I'm using Tomcat 4.0.1 with mod_webapp, I hope this help you.

JayPee
02-13-2002, 02:21 AM
Hey!

The context path is the URI that lets Tomcat know that you want it to serve the request, rather than letting Apache manage it.

So, for example, if your site is at http://www.domain.com and you set the context path to be "mytomcatapp", then any requests underneath the URL http://www.domain.com/mytomcatapp are passed to Tomcat by Apache.

If a request came thru containing the URI http://www.domain.com/someotherdirectory then Apache would serve it: it's not in Tomcat's "context" in this case.

Tomcat 4 isn't very well documented yet, so the setup can be rather confusing. My best advice is to check your error logs for a hint about what's going wrong, and take a look through the www.jguru.com FAQs and forums.

Good luck!

Jason