Apache, Mongrel (cluster) and Rails are on a load balancer no comments

Posted by stephane Sat, 22 Sep 2007 19:04:00 GMT

Following the conference, and some information about scaling Rails application, I decided to investigate about it and write a post on it.

First, I tried to install FreeBSD as recommended for small configuration… Well, I still don’t get it, I’m not fan of this installation and stop trying to understand, instead I installed a Debian 4.0R1, not so bad and closer to what I know :)

Secondly, I want to try Nginx. First, need to find the good one to install on Debian, not last dev, maybe the one on the testing repository. Finally I found package with the 0.5.31, latest stable version. Easy to install with dpkg, I only wanted to simply configure static server and point on php application I have. Ouch, the php-cgi stuff is pretty much more complicated than expected, I had a look to a Rails configuration and gave up :p.(update: configuration of one server is not so complicated, at least for rails, not more than load_balancer in apache, but it is for php and if you want to dispatch URL on the same domain, it doenst seem trivial)

Then I went back to something I can handle: apache. I have read some article about 2.2 you can use with load_balancer and several mongrel instances. Let’s go for it. I found a very complete article: Time For A Grown-Up Server: Rails, Mongrel, Apache, Capistrano and You used also by mongrel website about Apache Best Practice Deployment.

As I faced some issues, please be careful about the following:

1/ Mods to activate:

a2enmod proxy
a2enmod proxy_http
a2enmod rewrite
a2enmod deflate
a2enmod headers
a2enmod cache
a2enmod mem_cache
a2enmod file_cache 

2/ Forbidden access ? If you have some issue with forbidden access please check your proxy conf file and replace

Order deny,allow
Deny from all

by

Order allow,deny
Allow from all

Enjoy!

I’ll try again Nginx and maybe also pen / pound and litespeed. A buzzy load balancer: HAProxy. A lot of work is coming :p. If you have some feedback about these configuration don’t hesitate to share it :)

Comments

Leave a response

Comments