[Mongrel] Session problem mongrel behind Apache proxy
terry.reese at oregonstate.edu
Wed Apr 25 12:18:50 EDT 2007
Could be -- this is the first time using the balancer with Mongrel so
something could be out of wack. Anyway, here's the Virtual Host code
# Virtual Hosts
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most
# use only name-based virtual hosts so the server doesn't need to worry
# IP addresses. This is indicated by the asterisks in the directives
# Please see the documentation at
# for further details before you try to setup virtual hosts.
# You may use the command line option '-S' to verify your virtual host
# Use name-based virtual hosting.
SetEnv RAILS_ENV production
ServerAdmin terry.reese at oregonstate.edu
CustomLog /usr/local/apache-lf3/rails/log/access.log common
RewriteRule ^(.*/)?.svn/ - [F,L]
ProxyPass /images/ !
ProxyPass /stylesheets/ !
ProxyPass /error/ !
ProxyPass /icons/ !
ProxyPass / balancer://libraryfind/
ProxyPassReverse / balancer://libraryfind/
Options +FollowSymlinks +ExecCGI
Allow from all
ErrorDocument 500 "<h2>Application error</h2>Rails application failed
to start properly"
ErrorDocument 502 "<h2>Application error</h2>Unable to talk to
> -----Original Message-----
> From: mongrel-users-bounces at rubyforge.org
> [mailto:mongrel-users-bounces at rubyforge.org] On Behalf Of Sean Brown
> Sent: Wednesday, April 25, 2007 9:09 AM
> To: mongrel-users at rubyforge.org
> Subject: Re: [Mongrel] Session problem mongrel behind Apache proxy
> On 4/25/07, Reese, Terry <terry.reese at oregonstate.edu> wrote:
> > > Hi,
> > >
> > > I've configured mongrel_clusters behind an Apache 2.2 proxy using
> > > named virtual host. Session are saved as ActiveRecordSession. But
> > > the cookies created on client side doesn't correspond to session
> > > data saved in database (keys are different). The RoR app
> react just
> > > like it doesn't have a session at all.
> > >
> > > If I don't use Apache as a proxy/load balancer and call directly
> > > Mongrel_cluster, everything works well.
> > >
> > > What should I do to get session working with Mongrel behind an
> > > Apache proxy/load balancer ?
> > I'm curious -- did you find a solution to this problem. We have
> > recently moved from a single mongrel thread to a placing mongrel
> > behind Apache's load balancer and we are running into the
> same problem
> > -- the initial request to the application initiates a session, but
> > subsequent requests fail because the session data is empty.
> Like you,
> > if we don't use the load balancer it works fine.
> We've been working with the exact situation you both outline
> above, but we've had no issues like you've described. To be
> clear, we've
> 6 mongrels (clustered)
> Apache 2.2 proxying and load balancing, (as well as handling
> the static content)
> Would you mind posting your Apache Virtual Host block? My
> guess is a misconfiguration there.
> Mongrel-users mailing list
> Mongrel-users at rubyforge.org
More information about the Mongrel-users