On Mon, Jul 10, 2006 at 01:04:59PM -0400, Mike Garey wrote:
> On 7/10/06, Jens Kraemer <[EMAIL PROTECTED]> wrote:
> > On Mon, Jul 10, 2006 at 09:14:01AM -0400, Mike Garey wrote:
> > > On 7/10/06, Jens Kraemer <[EMAIL PROTECTED]> wrote:
> > > > On Fri, Jul 07, 2006 at 06:30:42PM -0400, Mike Garey wrote:
[..]
> > >
> > >   ProxyPass / balancer://myapp/
> > >   ProxyPassReverse / balancer://myapp/
> >
> >     ^^^
> >
> > These two lines will make Apache pass *all* requests below / to the
> > balancer. try commenting them out, the [P] rewrite rule should be
> > enough.
> 
> I commented out those two lines and sure enough, apache will serve
> static content even when mongrel is stopped..  What I don't understand
> though is that regardless of whether the two lines are
> enabled/disabled, my rewrite log shows the same thing:
> 
[..]
> so it looks like it's passing the files directly through apache in
> both cases, yet it will only work if mongrel is started when the
> ProxyPass lines are enabled.. (otherwise I get the service temporarily
> unavailable message).
> 
> So to break it down, I have the following 3 scenarios:
> 
> 1) mongrel_cluster is runnning, 'ProxyPass / balancer://myapp/' and
> 'ProxyPassReverse / balancer://myapp/'  are enabled -> both static
> content and dynamic content is served
> 
> 2) mongrel_cluster is stopped 'ProxyPass / balancer://myapp/' and
> 'ProxyPassReverse / balancer://myapp/'  are enabled -> neither static
> nor dynamic content is served
> 
> 3) mongrel_cluster is stopped 'ProxyPass / balancer://myapp/' and
> 'ProxyPassReverse / balancer://myapp/'  are disabled-> static content
> is served, dynamic content isn't
> 
> So this all makes sense, the only thing that's confusing is:
> 
>  A) the rewrite log contains the same thing in all 3 scenarios (you'd
> think in scenario 1 that it would show that the requests for static
> content are actually being sent through the balancer, rather than
> showing "pass through", which seems to indicate that it's being served
> directly by apache)

actually, the rewrite rules are always executed, that's why the rewrite 
log is the same in any case. ProxyPass, if present, will then step in
after the 'pass through', forwarding your request to mongrel, regardless
of any rewriting done before, since the / pattern always matches.

> B) The fact that none of the comments on the original tutorial site
> <http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you/>
> mention anything about these 'ProxyPass /' lines preventing any static
> content being served by apache.  This is of course not to say that I
> should take the instructions on that website as 100% accurate, but it
> just makes me want to double check that I'm indeed doing the right
> thing.

that may be because it's an issue one doesn't notice in the first place,
as everything appears to be working fine. 

> Anyway, thanks for the help guys, so far everything seems to be
> working the way I want.

glad to help :)

Jens


-- 
webit! Gesellschaft für neue Medien mbH          www.webit.de
Dipl.-Wirtschaftsingenieur Jens Krämer       [EMAIL PROTECTED]
Schnorrstraße 76                         Tel +49 351 46766  0
D-01069 Dresden                          Fax +49 351 46766 66
_______________________________________________
Mongrel-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/mongrel-users

Reply via email to