Hi and thank you very much, Craig.

Actually I didn't expect such an complete answer.
I think it could replace that FIXME in (...)/tomcat-docs/config/warp.html

Would you answer one more question, please?
I have posted it here recently and then in dev-list.
It was about "Client connection closing".

I believe that situation is mentioned in 
RFC 2616 "HTTP 1.1 protocol"
and both sides of connection should watch if 
the connection is still alive.
As far as I understand server programmers should 
be able to detect connection closing (e.g. Stop button
in browser was pressed).
Did I get it right or, if not, where is my mistake?

BTW, I'm considering to do it myself and if it seems
useful to Tomcat users and developers I'd like to
discuss the way such feature should be done since
I don't see a way to find a place for it in the present specs.


> -----Original Message-----
> From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 21, 2002 7:58 PM
> To: Tomcat Users List
> Subject: RE: mod_webapp and php
> 
> 
> >
> > Thanks for clarification, Craig But then again, what if the static
> > content (e.g. some html pages) resides inside web-app, is it than
> > considered static? Will Apache serve it from there directly (I believe
> > not, cause it could be on a different host) or will mod_webapp pre-cache
> > it in some place Apache is aware of or will such content be served by
> > Tomcat? (that is what I think for now)
> >
> 
> Your impression of how it works seems to be inaccurate.  There is no
> caching going on anywhere.
> 
> Let's look at the Tomcat stand-alone case first, and then examine the
> combined case.
> 
> Technically, from the point of view of Tomcat 4 (details are slightly
> different in 3.3), there is no such thing as "static content" -- all
> requests are handled by a servlet.  If you look in the
> $CATALINA_HOME/conf/web.xml file, which defines default configuration
> settings for all webapps, you will see a servlet named "default" that is
> mapped to the URL pattern "/".  This pattern means, "use the 'default'
> servlet whenever no other servlet is matched by a particular request URI".
> So, requests for things like "index.html" and "logo.jpg" don't match any
> of your application servlets or JSP pages, so they are handled by the
> default servlet -- which simply serves the contents of the corresponding
> file back to the client.
> 
> Now, let's consider what happens when you put Apache and a web connector
> in front of Tomcat (the concepts apply equally to mod_jk and mod_webapp,
> only the configuration details differ).  Essentially, what people try to
> do is make Apache itself be the default file-serving servlet, instead of
> the one built in to Tomcat.
> 
> This is accomplished in your configuration directives, where you tell
> Apache which requests to forward (and by implication, all other requests
> are handled by Apache itself in the usual way).  Thus, when we add a
> diretive that says "forward all *.jsp requests to Tomcat", we are telling
> Apache that any request that ends with ".jsp" MUST be forwarded to Tomcat
> for processing.  Apache acts like a proxy server for these requests -- it
> just calls Tomcat and then copies back the response Tomcat creates to the
> original client.
> 
> If you do not have any such configuration directives for "*.html" and
> "*.jpg" patterns, then Apache serves them directly, based on your Apache
> configuration directives in httpd.conf.  It is NOT an issue of pre-caching
> or anything like that -- the request either gets forwarded to Tomcat or it
> doesn't.
> 
> Now, if you configure Apache so that the directory being served by the
> "/foo" request URI prefix is the same as the directory defined as the
> context root of the "/foo" web app in Tomcat, you've accomplished the goal
> -- Tomcat serves all the requests that Apache forwards to it, and Apache
> serves all the requests that it doesn't forward.  But your application
> code is identical in either case.
> 
> Keep in mind that the ACTUAL directory pathname of your webapp doesn't
> need to have anything at all to do with the "/foo" prefix on requiest
> URIs.  Both Apache (via the "Alias" directive) and Tomcat (via the
> "docBase" attribute of the <Context> element) let you map that prefix to
> whatever real directory you want -- the secret is to make sure they both
> point at the same place.
> 
> Lastly, I want to emphasize again, NONE of this is new to mod_webapp --
> the mod_jserv and mod_jk connectors have worked this way for around five
> years.  The only new thing mod_webapp was supposed to bring to the table
> was automatic configuration of the httpd.conf directives that make all of
> this happen, instead of requiring the sysadmin to do it all yourself.
> 
> Craig
> 
> 


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to