opensoul.org

RPMs for Deploying Rails on CentOS

August 2, 2006 code 2 min read

Thanks to mongrel, Ruby on Rails deployment is finally decent. Several weeks back I switched all of our servers over to using Apache 2.2 with mod\_proxy\_balancer, mongrel and mongrel\_cluster, and I haven't had any problems.

Unfortunately, since most of our servers run CentOS (repackaged RedHat Enterprise Server 4), the setup isn't as easy as it could be since it ships with Apache 2.0 and ruby 1.8.2, which doesn't work with Rails. So I've rebuilt all the necessary RPMs (and more) and made them available to make deploying a snap. Note: these packages should also work on RedHat Enterprise Linux 4, however, I have not tested them.

Yum configuration

Download or create the yum config in /etc/yum.repos.d/ file with the following contents:

[ci]
name=[i] Collective Idea RPM Repository
baseurl=http://source.collectiveidea.com/pub/linux/centos/4/i386
gpgcheck=1
enabled=1
gpgkey=http://source.collectiveidea.com/pub//RPM-GPG-KEY

Install Packages

To install the packages, run:

yum install httpd ruby ruby-devel rubygems ri
Note: If you already have Apache and other modules installed, this command may fail. You can try running yum upgrade, or you may just need to remove the packages before you install the new packages. If you're using any packages, such as other Apache modules, that I haven't rebuilt against Apache 2.2, let me know and I can add them.

Install Gems

Install the gems you need by running:

gem install -y rails mongrel mongrel_cluster

Configure Apache and Mongrel

Lastly, follow one of the guides for configuring Apache and mongrel.

Let me know if you have any problems with these packages.

This content is open source. Suggest Improvements.

@bkeepers

avatar of Brandon Keepers I am Brandon Keepers, and I work at GitHub on making Open Source more approachable, effective, and ubiquitous. I tend to think like an engineer, work like an artist, dream like an astronaut, love like a human, and sleep like a baby.