Hi, I'm Benedikt Deicke. I'm a web and software developer at flinc. I'm mainly building user focused web applications using Ruby on Rails and JavaScript. Additionally I'm currently finishing my studies for my master's degree and enjoying photography in my spare time. Feel free to get in touch with me!

August 8th, 2008
HowTo: Phusion Passenger aka mod_rails for Apache

Yesterday I decided to give Phusion Passenger aka mod_rails a try and installed it. It was dead simple to set it up and to deploy rails applications with it. I’m now using it for several “small” applications, for which the whole overhead of setting up a cluster of mongrels and a proxy doesn’t seem to be adequate. I’ll give you a short summary on how to install mod_rails for apache2 on Debian Etch.

First, install the passenger gem using RubyGems (if you don’t have Ruby and RubyGems running on your server, install them first – of course):

   1  gem install passenger

Afterwards, run the passenger apache2 module installer using this command:

   1  passenger-install-apache2-module

It’ll check for the required software to install the module, compile it and copy it to the correct folders. If some software is missing install it using aptitude (ie. aptitude install g++ if you’re missing the GNU C++ Compiler).

Next, create two new files in the /etc/apache2/mods-available directory. One called mod_rails.load:

   1  LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.0.2/ext/apache2/mod_passenger.so

... and the other one called mod_rails.conf:

   1  PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.0.2
   2  PassengerRuby /usr/bin/ruby1.8

Now you can enable the module using a2enmod and restart apache.

   1  a2enmod mod_rails
   2  apache2ctl restart

That’s it! Now simply deploy your rails application, just make sure apache’s document root is pointing to your applications public folder. Passenger will automatically detect your rails application and start up processes as needed. You can check it’s status and stats using the passenger-status and passenger-memory-stats commands. For more details on mod_rails, take a look at it’s documentation.

Posted by benediktFiled in Articles, Linux, Ruby, Ruby on Rails
Bookmark and Share

1 Comments for “HowTo: Phusion Passenger aka mod_rails for Apache”

  1. Effineinvew Effineinvew said on June 9th, 2011 at 08:21 PM:

    We Purchase Houses With No Even-handedness,We Bribe Any Houses,We away Floor Payments.Please close form on http://www.cashsellfast.com and irritate tender in 48 hours or call us 410-978-7981,please refer to friends who emergency help.Bless heyday!

    Attention Landlords and Rehabbers: If you are a solemn investor buying at least anyone firm per compassion in the interest rental or rehab, then you are in the healthy place veracious now. http://www.renewreality.com.

    Proprietress Financing May Be The Hidden Colloidal suspension Learn How To Own A Snug harbor a comfortable Without Dealing With A Bank! Search out The Horrific Actuality About Renting & Why It May Be Background You Pursuing Financially??¦ Get better Insider Secrets on How Owner Financing Honestly Works http://www.reimatcher.com/Baltimore/Reality_properties/sp1.

    Need Unconventional Start? We can help.Painting company can coat your house within desired loiter again and again shape, in colors of your choice with best discounts for paints,with adequate alongside client quality. Objective prices,references,license,union,insuranse.For pictures of your works suit stopover http://www.renewhouse4u.com.

Leave a comment