You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by William Claxton <wi...@openasia.net> on 2003/02/25 06:09:09 UTC

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. 

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?


        Regards, Bill Claxton [williamc@openasia.net]
        OpenAsia Solutions provides streaming media & payment solutions.
        Check out http://www.openasia.net
........:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: need 2 appbase settings

Posted by William Claxton <wi...@openasia.net>.
>> Date: Tue, 25 Feb 2003 13:09:09 +0800
>> From: William Claxton <wi...@openasia.net>
>> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
>> To: tomcat-user@jakarta.apache.org
>> 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
>paths).
>
>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?
>>
>>
>
>Craig
>

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"
         reloadable="true">
       </Context> 
	{...}
      </Host>
	{...}

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

	http://www.openasia.net:8080/examples/servlet/HelloWorldExample

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

	http://www.openasia.net:80/examples/servlet/HelloWorldExample

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 [williamc@openasia.net]
        OpenAsia Solutions provides streaming media & payment solutions.
        Check out http://www.openasia.net
........:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: need 2 appbase settings

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Tue, 25 Feb 2003, William Claxton wrote:

> Date: Tue, 25 Feb 2003 13:09:09 +0800
> From: William Claxton <wi...@openasia.net>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org
> 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.
>

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
paths).

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?
>
>

Craig
k

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org