Installing Phusion’s Passenger on CentOS (for Ruby 1.9)

As a prerequisite you have to have installed Ruby 1.9.x on your CentOS system.

If you don’t know how to do it, follow the instructions on this post:

Installing Ruby 1.9 on CentOS

Once you are ready follow the next steps:

On a terminal type:

gem install passenger

$ passenger-install-apache2-module

This last command is going to walk you through the process of installation,

helping you install whatever is missing on your system and at the end giving the instructions

to “patch” your apache’s configurations file.


On my case, I had to install the following modules:

$ yum install httpd-devel

$ yum install apr-devel

$ yum install apr-util-devel

After installing them re-run the command again

$ passenger-install-apache2-module

And then edit the apache configuration


Ad the following lines to the file:

LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/ext/apache2/
PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.2
PassengerRuby /usr/local/bin/ruby
And finally configure your VirtualDirectories (on the same file)
<VirtualHost *:80>
DocumentRoot “/var/www/virtualhost/”
<Directory “/var/www/virtualhost/”>
AllowOverride all
Options -MultiViews
Now reboot the apache server
$ /etc/init.d/httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
Now you are ready to go.
Test the site

One thought on “Installing Phusion’s Passenger on CentOS (for Ruby 1.9)

  1. Pingback: Deploying GeneXus applications on CentOS with Ruby 1.9 and mysql (part 1) « Shared Knowledge

Leave a Reply

Your email address will not be published. Required fields are marked *