Ruby on Rails - Deployment

June, 2008

The rails book has you carry on through the first 21 chapters using the webrick server before facing the issues of deployment on a real web server. Although I halt just before accusing them of sweeping serious issues under the rug, I do have to warn potential rails enthusiasts that they will face some adventures when they get to this stage of the game.

Taking the philosopy of "boldly rushing in where angels fear to tread", I tackled these issues up front and insisted on doing almost all of my rails learning on a real web server.

I first tried to make this work with Apache 2.0, hoping to have a "rails corner" as part of an existing website. I gave up on this and moved my existing website to lighttpd, and then tried again. I once again found myself banging my head against walls, and then took two steps back and set up a virtual host for the rails part of my site and have been happy ever since (more or less). Details of my experiences in doing all of this follow. If I sound bitter and frustrated in some of what follows, that is because I was bitter and frustrated at the time when I wrote this.

First steps with Rails

This short note details my intial enthusiasm following the "agile" book and using WEBrick for a server on port 3000.

Rails and lighttpd

I am just getting going with this after getting totally disgusted with Apache 2.0 and fastcgi (actually fcgid). See below for this miserable story. I am told that bad and ugly things that I haven't probed yet await in Apache 2.2 (Fedora Core 5), so this very well may have been a good choice. Lighttpd looks promsing so far.

Further steps with Rails, lighttpd, and MySQL

My Experiences with Apache 2.0

I should note right here that after almost a week of frustrating effort, I gave up on the whole rails and apache business and switched to working with lighttpd, and so far that looks like a great choice.

I suspect that my problem was with something funky in the fedora /etc/httpd/conf.d group of configuration files that was interfering with rails, but that is just a hunch ....

My efforts were done on a Linux system running Fedora Core 4, Apache 2.0.54, and ruby 1.84 as of the time of this writing. (July, 17, 2006).

The following links document the steps in my effort to make this work.

mod_proxy saves the day

This note was added in June of 2008. I am now running fedora core 8, and running both apache and lighttpd. I run apache on port 80, and lighttpd on port 8080, and use lighttpd exclusively for rails. I use modproxy to hand off the rails stuff from apache to lighttpd, and this works wonderfully (I did it the other way for a while, but this seems the better plan). I used lighttpd alone for a while, but then wanted to set up a mod_dav SVN repository, and though I probably could have worked this out with lighttpd, making apache the main server seemed the way to go. My rails sites are very low traffic, so I am not even worried about efficiency issues. I am not sure at what traffic level I would worry.
Feedback? Questions? Drop me a line!

Ruby on Rails notes / tom@mmto.org