tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William Claxton <>
Subject Re: need 2 appbase settings
Date Wed, 26 Feb 2003 13:42:43 GMT
>> Date: Tue, 25 Feb 2003 13:09:09 +0800
>> From: William Claxton <>
>> Reply-To: Tomcat Users List <>
>> To:
>> Subject: need 2 appbase settings
>> We have successfully moved our appbase to a folder other than Tomcat's
>> default.  However, this means we can no longer see the manual pages or the
>> Tomcat servlet examples.
>> I believe the correct approach would be to create 2 host entries in
>> 'server.xml', one with the default appbase (where we'd find the Tomcat
>> manual and examples), and one for the modified appbase (where we'd find our
>> own applications).  There may also need to be modifications to the Apache
>> configuration, to enable virtual hosting.
At 09:41 PM 2/24/03 -0800, you wrote:
>That technique would work.
>So would putting an explicit <Context> element inside the standard <Host>
>element, with a docBase attribute pointing back to where the files really
>are (remember, both docBase and appBase can be absolute or relative
>An even simpler approach, of course, would be to just copy or move the
>"tomcat-docs" into your new "appBase" location -- then, the automatic
>recognition will find them again.
>> Has anyone done this?  If so, can you provide snippets from your
>> 'server.xml' and perhaps 'httpd.conf' to show us how it's done?

An update on this issue... 

We're trying to use Craig's solution - create a context that points to the
absolute address of the Tomcat examples.  This will save making the DNS
changes required for a virtual host.

For presenting the tomcat documentation, adding a server alias in Apache
does the trick.  But we're still having trouble making the servlet examples
work.  Here's a snippet of the 'server.xml'.

      <Host name="localhost" debug="0" appBase="/home/web" unpackWARs="true">
        <Context path="/examples"
docBase="/usr/local/jakarta/jakarta-tomcat-4.1.18/webapps/examples" debug="0"

When we access an example servlet using port 8080, it works fine:

When we access the same servlet using port 80 (via Apache), it fails with a
404 error:

This, despite the fact that the 'mod_jk' connector is properly configured,
and works fine for other contexts.  

As expected, the Apache access log reports:

	"GET /examples/servlet/HelloWorldExample HTTP/1.1" 404 1068

Apache error_log reports:

	File does not exist: /home/web/sites/openasia/site/htdocs/examples

Incidentally, the path '/home/web/sites/openasia/site/htdocs' is our site
document root.  Finally, mod_jk.log reports:

	jk_uri_worker_map_t::map_uri_to_worker, done without a match

The file 'web.xml' in '/examples/WEB-INF' is straight from the default
installation, unchanged.  It includes a filter for the pattern '/servlet/*'.

Any ideas?

        Regards, Bill Claxton []
        OpenAsia Solutions provides streaming media & payment solutions.
        Check out

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

View raw message