tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aphra Behn" <>
Subject Apache and Tomcat VirtualHost Config Problem
Date Thu, 30 Dec 2004 01:54:42 GMT

I am currently using Apache httpd 2.0.52, Tomcat 5.0.28 and mod_jk2
configured with and so that tomcat can listen to
apache requests.  I want Apache httpd to serve static files and Tomcat
to serve dynamic files (ex. jsp's).

This all works fine if I have all dynamic files located on the url as

However, I cannot seem to get the dynamic files to work properly if I
want them to be at the same location on the url as the static files so
that (served by Tomcat as requested by Apache
httpd) and (served by Apache httpd) coexist
without any problems.

I did come up with a config that works partially for jsps at but there are some problems.  This is the main

Eventhough I am able to access all the jsp page inside
CATALINA_HOME/webapp/home, I am no longer able to access any jsp page
inside other directory such as CATALINA_HOME/webapp/sample directory.

I have included all relevant config settings below this paragraph.
What can I do diffrently so that Apache can make a direct request to
both CATALINA_HOME/webapp/home and CATALINA_HOME/webapp/sample instead
of just one?  It seems to me that with my original setting (above
mentioned as, requests from Apache will
start from CATALINA_HOME/webapp and start going through different
directory and display it through the url each time it enter a
subdirectory.  However, with my current setting, instead of starting
at CATALINA_HOME/webapp, I just start at CATALINA_HOME/webapp/home, so
eventhough I make a request from, "home" does not show
up anymore, but that also makes it impossible to access files from a
directory such as CATALINA_HOME/webapp/sample.  What kind of
configuration do I need to make Apache access a jsp page from Tomcat
without showing up a long url path but instead just something like no matter which folder the jsp page is located
inside tomcat?

Here are the relevant config lines:

1)Inside server.xml, I enter the following:
      <Host name="" debug="0"
               unpackWARs="true" autoDeploy="true">
              <Context path="" docBase="" debug="1"/>
              <Valve className="org.apache.catalina.valves.AccessLogValve"
               directory="logs"  prefix="home_access_log." suffix=".txt"
               pattern="common" resolveHosts="false"/>

      <Host name="" debug="0"
              unpackWARs="true" autoDeploy="true">
              <Context path="" docBase="" debug="1"/>
              <Valve className="org.apache.catalina.valves.AccessLogValve"
               directory="logs"  prefix="cust2_log." suffix=".txt"
               pattern="common" resolveHosts="false"/>

2) Inside, I include the following:*.jsp]


3)  Inside httpd.conf, I include the following:
      DocumentRoot /usr/local/httpd-2.0.52/htdocs/
      <Location "/*.jsp">
              JkUriSet worker ajp13:localhost:8009

If anybody knows of a great source of documentation on this I would
like to know.  I have searched online and read through a lot of
documentation such as  "Apache 2.0.43 - Tomcat 4.1.12 - jk2 - virtual
host HOWTO" at,
document about mod_jk2 at  and at,
document about server.xml at,
document about virtual host  at .

Thanks in advance for your help!

Donít just search. Find. Check out the new MSN Search!

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message