Ruby on Rails Deployment
While RoR is a blast to develop with, it’s taken a while to get reasonable documentation and solutions for deployment. I spent the morning flipping through my Rails Cookbook looking for a good solution for the LOL.com application. My first attempt is going to be with Recipe 13.3 – Hosting Rails with Apache 2.2, mod_proxy_balancer, and Mongrel. Basically this solution uses Apache as a load balancing proxy that forwards requests to a mongrel cluster.
Why The Complexity?
Basically, Ruby on Rails is single threaded and you have to complexify your deployment to deal with the limitation. I’m not saying that the RoR developers choose a bad model, they just happened to pick a more heavy weight model. It also moves the complexity of threading issues out of the realm of development, which some would say improves the development experience.
Setting up the Server
The experiment is going to be conducted using Ubuntu 6.10 server installation in a VMWare VM. The final deployment will probably be Fedora because that’s what we have on destination machine, but I want to experiment with Ubuntu server so I’m killing two birds with one stone.
It’s always a good idea to Google
Five minutes later I have a recipe for getting the ubuntu server set up with ruby, apache 2.2, and other items.
As I’m going through the recipe, I’m starting to seriously consider using a VM for production. If this goes as smoothly, then it might be worthwhile to just put the VM in the datacenter. The other possiblity is to temporarily take the website down and rebuild the box.
Changes to the Recipe
I chose to use httpd-2.2.4 so I pulled it from a mirror site. Also make sure to choose the most recent non mswin32 options when installing mongrel.
Status
At this point everything seemed to install fine. Next stop…and another day. Configuring the rails app.