Get updates

Scott Easing into Rails Deployment with Mongrel

Like the good [Rails] book says, Apache plus FastCGI is the way to go. Or is it?

It’s been a while since I’ve been free to work on ListFinity, just recently I was able to start addressing the question of deployment: How can I get my Rails application running on a local server, in “stable” production mode while I tinker away separately on the development version?

Of course I had to start by following my Rails book’s advice.

The much-touted solution of Apache plus FastCGI required, well, getting Apache running. Okay, done. Then CGI- check. Then Rails with CGI on Apache… wow we’re losing altitude quickly.

Tackling the Rails on Apache beast proved troublesome. In openSUSE 10.2 Apache is not, in my experience, an open-the-box-you’re-done proposition for Rails. I’m sure Apache is a great web server, I’ve used it in nearly every hosting account I’ve worked on, but of course that’s always a situation where someone else has already done the work of configuring and setting it up.

While I intend to learn all about Apache, at some point, right now I just need to get on with some development in Rails.

Mongrel to the rescue! Aside from initially missing GCC (this was a very fresh and vanilla openSUSE installation), getting Mongrel installed by Gems was a piece of cake, as it should be. Running my Rails app in Mongrel? Also super easy. Essentially the same amount of effort as WEBrick, which is to say almost zero.

I’m confident that further down the road I’ll be ready to get into, and understand, Apache’s multitude of options. Right now though the decision to go with Mongrel has changed local deployment of my Rails application from a quagmire into a done deal, so I can get back to the fun stuff.

If you happen to be in a similar situation, I recommend Mongrel. Perhaps it’s not as sophisticated a solution as Apache + ??, but it is easy and you can move on to programming faster. Plus some evidence suggests deploying to a Mongrel cluster may be useful in the “real world” as well.

Leave a Reply