On Sat, 19 Jan 2002, Nikola Milutinovic wrote:
> Date: Sat, 19 Jan 2002 17:58:35 +0100
> From: Nikola Milutinovic <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> Subject: Re: mod_webapp and php
>
> Craig R. McClanahan wrote:
>
> >
> >>I cannot fathom how they plan to do that, since it would violate the
> >>view of a "web application" as a sealed component on the "servlet
> >>container". I mean suppose you have a WELCOME.GIF file in your web
> >>application, how is Apache supposed to serve it, other than through
> >>WARP? Pre-caching of all static content upon "Warp Deployment"?
> >
> > The original design goal was to make a decision based on the incoming
> > request URI of each request, by asking the following questions:
> > * Is this request URI matched by a filter mapping?
> > * Is this request URI matched by a servlet mapping?
> > * Is this request URI matched by a security constraint?
> > If the answer to any of these questions is YES, the request must be served
> > by Tomcat, to maintain the semantics required by the servlet
> > specification.
> >
> > On the other hand, if the answer to all of these questions is NO, there is
> > no semantic problem with allowing Apache to serve this resource, instead
> > of the default file-serving servlet in Tomcat.
>
>
> So, there is only one bit unclear to me. How was Apache supposed to serve it?
> Basically, my webapp directory is not within Apache's DocumentRoot. Is Apache
> going to cache the static content or what?
>
If you've ever configured a web connector (such as mod_jk) for Tomcat, you
know how this works -- you set up an alias, or a path prefix, in Apache
that matches the context root of a Tomcat webapp, and then set up the
configuration directives telling Apache to forward only the things Tomcat
needs to care about -- everything else is served by Apache just as if
Tomcat wasn't there. The key issue is making your Apache document root
and Tomcat document root match.
The only thing different about the way mod_webapp was intended to work is
that all the configuration stuff was supposed to get done for you
automatically, instead of needing a complex autogenerated include file for
httpd.conf that doesn't always get all the details right.
>
> >>Or perhaps, not pre-caching, but just simple caching? Man, that is
> >>dangerous. Suppose I keep my GIFs in database and I upload new GIFs. OK,
> >>OK, perhaps it is not a good idea to remap *.gif to a servlet, since
> >>browsers might cache it, too.
> >
> > If you remap "*.gif" to a servlet, the request would always be served by
> > Tomcat, in accordance with the rules above.
>
>
> Yes.
>
>
> > Uploading new GIFs, and expecting them to be served, would "violate the
> > view of a 'web application' as a sealed component on the 'servlet
> > container'" :-).
>
>
> Indeed. :-)
>
>
> >>Anyway, a web application with a whole lot of static content might need
> >>some re-modeling?
> >
> > I don't see why.
>
>
> Why is it a "web application" if it has a lot of static content in it? Let
> Apache be burdened with static part of your presentation and keep truly dynamic
> parts as web apps.
>
The days when things were always 100% static or 100% dynamic are pretty
far behind us. The theory behind the way web connectors for Tomcat work
is to let Apache serve the static part, and Tomcat serve the dynamic part,
so you can have any desired combination of static and dynamic content
seamlessly.
>
> Nix.
>
Craig
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>