Here is how I have installed the rubygems passenger module on my Debian Lenny Linux.
1. Install the module via ruby gem
debian:~# gem install passenger
2. Invoke the passenger-install-apache2-module to install the module
debian:~# passenger-install-apache2-module
If everything compiles fine with your passenger module you can skip the rest of the text in step 2 as well as the step 3, however;
Here first time I tried to compile the module I got an compilation errors because I was missing the following packages installed:
libopenssl-ruby libopenssl-ruby1.8 libcurl4-openssl-dev
Apart from this list I needed to install also the apache2-prefork-dev package installed as well as the rake (ruby build program)
Two other packages that might be necessary for the successful compilation of the passenger-install-apache2-module are:
zlib1g-dev libzlib-ruby
Thus best thing to do now is to use apt-get install to fetch and install for you all necessary components for the ruby passenger module compilation to succeed:
3. Install following debian packages before you proceed with passenger-install-apache2-module
debian:~# apt-get install libopenssl-ruby libopenssl-ruby1.8 libcurl4-openssl-dev rake apache2-prefork-dev zlib1g-dev libzlib-ruby
4. Invoke the passenger-install-apache2-module again if it failed in step 2
debian:~# gem install passenger
Hopefully now everything should compile fine.
5. Edit your apache2.conf to load the passenger module into Apache
In /etc/apache2/apache2.conf place the lines which will appear as a text after your passenger compilation is completed on your screen, in my case what I needed to include in my apache2.conf was:
LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.0/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.0
PassengerRuby /usr/local/bin/ruby
As you can see from below I had a custom installed ruby and that’s why the location of my ruby and its libraries are into the /usr/local/ dir.
Last step left is to configure a Virtualhost for your Ruby on Rails application :
6. Configure Virtualhost for your ruby on rails app
You will need to use a virtualhost similar to:
<VirtualHost *:80>
ServerName www.yourhost.com
DocumentRoot /somewhere/public # <-- be sure to point to 'public'!
<Directory /somewhere/public>
AllowOverride all # <-- relax Apache security settings
Options -MultiViews # <-- MultiViews must be turned off
</Directory>
</VirtualHost>
Of course you will also need to restart your apache for the new module to get loaded
debian:~# /etc/init.d/apache2 restart
Besides my instructions you might be interested into the following video explaining the installation process of mod passenger
Cheers 🙂
More helpful Articles
Tags: Installing passenger with ruby gems on Debian Lenny