tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Ahten <pi...@pixelfreak.net>
Subject Re: Strategy for Hosting Multiple Sites with Apache / Tomcat
Date Tue, 08 Apr 2003 15:30:23 GMT
John,

Thanks for you input on this issue. This leads me to additional 
questions listed bellow...

On Tuesday, April 8, 2003, at 08:45  AM, John Turner wrote:

> On Mon, 7 Apr 2003 18:27:48 -0400, Scott Ahten <pixel@pixelfreak.net> 
> wrote:
>
>> 01. Separation of Dynamic and Static Content
>>
>> Currently, all content for each domain lives in a single webapp and 
>> host with it's own document root. This is very convenient since we 
>> only have to update a single directory tree when changes are made to 
>> a site. Based on my observations, I will need to separate dynamic and 
>> static content and store them in two different document roots - one 
>> for a Tomcat context/webapp and another for Apache static content. 
>> This seems very awkward and error prone. Is there a better way to do 
>> this?
>
> There is no requirement to do this.  Apache's document root can easily 
> be Tomcat's webapp root.  It doesn't matter where the file is coming 
> from, in this scenario you are just trying to set Apache as the server 
> for static content.  Where Apache finds that content is irrelevant. We 
> typically push our dynamic content into sub directories lilke /jsp and 
> /servlet.  In a virtual hosting environment, that may not be desired 
> for cosmetic reasons.  In any case, Apache's document root can be 
> virtually anywhere (as can Tomcat's, as long as you configure appBase 
> and docBase correctly). I've seen some configurations where admins map 
> "/static" as the location of static content.
>
> Using JK, two JkMounts will take care of this for you:
>
> JkMount /*.jsp ajp13
> JkMount /servlet/* ajp13
>
> JSP and servlet requests now go to Tomcat, Apache will server any 
> other request.  Where Apache finds the file to satisfy the request is 
> up to the admin.  It could be the same place where the JSP are stored, 
> or somewhere else.
>

a. Wouldn't Apache2 and Tomcat sharing the same document root cause a 
security issue with the WEB-INF folder? I guess I could try to block 
access to this folder on the Apache side using some type of directive 
in the HTTPD.conf or ht access file.

b. Not all of our content resides in the document root. It is nested in 
multiple folders based on the logical structure of the site. Example...

/index.html
/images/logo.gif
/contact/index.html
/contact/images/contact_header.gif
/contact/handle_contact.jsp
/contact/ack.jsp
/contact/nak.jsp
...

Do we need separate mount [or URI commands in our case with JK2] for 
each subdirectory or is there a way to define a single URI pattern that 
sends all JSP requests to Tomcat no matter where it exists in the 
directory structure?


> John
>
>> 02. Webapps or Contexts in Tomcat
>>
>> What is the most common way to separate dynamic content in Tomcat? 
>> Should I create a single host with a separate context for each domain 
>> or should I use multiple webapps instead?
>
> I use a separate Host for each virtual host.

c. The documentation on Mod JK2 isn't clear on how to specify a 
particular Tomcat Host when forwarding requests from Apache.

I'll post a separate message on clarifying how this is done to the list.

Thanks for your help,

~Scott


>
>>
>> ~Scott
>
> John
>
> -- 
> Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>


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


Mime
View raw message