You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jim Weir <ja...@hotmail.com> on 2006/08/31 21:06:29 UTC
RE: Apache + Tomcat configuration: static / dynamic content (with ROOT applicati
>From: "Chris Berthold" <CB...@terrafirma-productions.com>
>Reply-To: "Tomcat Users List" <us...@tomcat.apache.org>
>To: "Tomcat Users List" <us...@tomcat.apache.org>
>Subject: RE: Apache + Tomcat configuration: static / dynamic content (with
>ROOT application deployed)
>Date: Thu, 31 Aug 2006 12:27:28 -0400
>
>Place the static content in Apache in the directories that would be
>referenced by Tomcat. The way you did it will work but it is not
>recommended especially if you would like to deploy WAR files quickly and
>the static content does not change often. You can deploy the files to a
>different document root in apache and this solution will still work.
>You were close in what you needed to do. You are only missing a few
>entries
>
>JkUnmount /images/
>JkUnmount /webappA/images/
>JkUnmount /webappB/images/
>
>Jkmount will include an entire tree.
>Jkunmount excludes parts of the directory tree.
>
>-----Original Message-----
>From: Hua Hou [mailto:hua@handango.com]
>Sent: Wednesday, August 30, 2006 10:11 AM
>To: tomcat-user@jakarta.apache.org; users@tomcat.apache.org
>Subject: Apache + Tomcat configuration: static / dynamic content (with
>ROOT application deployed)
>
>I think this question had been asked before. But when I searched the
>tomcat user group, I don't find a satisfactory answer.
>
>
>
>Here is my question: How to configure Apache & Tomcat so that Apache
>handles static content for virtual host with more than one web
>applications?
>
>My web application directories are as following:
>
>/webapps/
>
>/webapps/webappA/
>
>/webapps/webappB/
>
>/webapps/ROOT/
>
>
>
>I have three web applications (contexts): the default(""),
>webappA("/webappA"), and webappB("/webappB"). Each application has both
>static content and dynamic content (JSP/servlet).
>
>
>
>in Apache httpd.conf, I have the following virtual host definition:
>
>
>
>NameVirtualHost *:80
>
><VirtualHost *:80>
>
> ServerName www.myserver.com
>
> DocumentRoot "F:/Tomcat5.5/webapps"
>
> JkMount /servlet/* worker1
>
> JkMount /*.jsp worker1
>
></VirtualHost>
>
>
>
>With this configuration, everything works, except that the static
>content for the default application (/ROOT) can't be loaded by Apache
>because Apache can't find the content.
>
>
>
>If I change the DocumentRoot to:
>
> DocumentRoot "F:/Tomcat5.5/webapps/ROOT"
>
>
>
>The static content for the default application can be loaded by Apache,
>but the static content for the other two web apps can't be loaded
>(outside of DocumentRoot).
>
>
>
>How can I configure virtual host so that the above problem can be
>solved?
>
>
>
>I did figure out a workaround, here it is:
>
>
>
>NameVirtualHost *:80
>
><VirtualHost *:80>
>
> ServerName www.myserver.com
>
> DocumentRoot "F:/Tomcat5.5/webapps/ROOT"
>
> Alias /webappA/ F:/Tomcat5.5/webapps/webappA
>
> Alias /webappB/ F:/Tomcat5.5/webapps/webappB
>
> JkMount /servlet/* worker1
>
> JkMount /*.jsp worker1
>
></VirtualHost>
>
>
>
>With the above configuration, all static / dynamic content for all the
>three web apps can be loaded properly. However, is this a standard /
>recommended configuration?
>
>
>
>Your help will be greatly appreciated!
>
>
>
>Best Regard,
>
>
>
>Hua Hou
>
>
>
>
>---------------------------------------------------------------------
>To start a new topic, e-mail: users@tomcat.apache.org
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>
..are you using JK 1.2.18?
Jim
_________________________________________________________________
All-in-one security and maintenance for your PC. Get a free 90-day trial!
http://www.windowsonecare.com/trial.aspx?sc_cid=msn_hotmail
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org