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:
> [..]
> >
> >
> > <VirtualHost *:80>
> > ServerName myapp.mydomain.com
> >   DocumentRoot /usr/local/www/data/vhosts/www.mydomain.com/current/public
> >
> >   <Directory "/usr/local/www/data/vhosts/www.mydomain.com/current/public">
> >     Options FollowSymLinks
> >     AllowOverride None
> >     Order allow,deny
> >     Allow from all
> >   </Directory>
> >
> >   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:

(2) init rewrite engine with requested uri /images/common/learn_more.gif
(3) applying pattern '^.*$' to uri '/images/common/learn_more.gif'
(4) RewriteCond:
input='/usr/local/www/data/vhosts/www.mydomain.com/current/public/system/maintenance.html'
pattern='-f' => not-matched
(3) applying pattern '^/$' to uri '/images/common/learn_more.gif'
(3) applying pattern '^([^.]+)$' to uri '/images/common/learn_more.gif'
(3) applying pattern '^/(.*)$' to uri '/images/common/learn_more.gif'
(4) RewriteCond:
input='/usr/local/www/data/vhosts/www.mydomain.com/current/public//images/common/learn_more.gif'
pattern='!-f' => not-matched
(1) pass through /images/common/learn_more.gif

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)

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.

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

Mike
_______________________________________________
Mongrel-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/mongrel-users

Reply via email to