[Gllug] OT: Tomcat & Apache mapping problem

Mike Brodbelt mike at coruscant.demon.co.uk
Tue Mar 22 19:43:07 UTC 2005


On Tue, 2005-03-22 at 18:40 +0000, Paul SAPSFORD wrote:
> Hi there,
>  
> in my server.xml file I have various context definitions for an
> application and the mapping is honoured correctly when in standalone
> Tomcat mode.
>  
> However, when Apache routes the same request to Tomcat, it overrides
> the context definitions and looks for JSPs in the parent directory and
> servlets in /servlets.

On the setup I have at work, I have a vhost defined in Apache the gets
all the request initially. My Apache is configured with mod_jk2, and my
workers2.properties has a stanza directing Apache to pass requests on
that vhost through to Tomcat:-


# URI mapping for the tomcat vhost -  mod_jk2 will intercept all
# requests to this vhost.
[uri:tomcat.example.com:80/*]
worker=ajp13:localhost:8009


The server.xml file then has a "host" section within the definition of
the AJP1.3 connector, which specifies the directory to serve JSPs from:-



<!-- Define the obhesearch.acu.ac.uk virtual host -->
<Host name="obhesearch.acu.ac.uk" debug="0" appBase="testvhost" 
      unpackWARs="true" autoDeploy="true">


Webapps for that vhost get installed under /var/lib/tomcat4/testvhost,
and Tomcat serves them for me.

That said, setting all this up the first time around was a pain in the
neck, and it's only Debian's packaging of tomcat and associated bits
that enabled me to keep smiling.... Every time I have to work with Java
based technology, I find something new to hate about it.

Mike.

-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list