rss

Installing mod_rails(Passenger)

Category : Ruby on Rails

Mod_rails has come to rescue people form tedious rails application development. With mod_rails the work has become a lot easier, you do not have to worry about different things just few steps and your application is up and running, ofcourse there are options to modify the deployment to your needs.

There are few prerequisites for mod_rails to work, first you need Apache and secondly you need Ruby and Rubygems.

Step 1: We need to update rubygems
sudo gem update

Step 2: We need to install mod_rails(passenger)
sudo gem install passenger

Step 3: Now we need to install Apache2 headers
sudo aptitude install apache2-prefork-dev

Step 4: Now we need to install Apache2 module
sudo passenger-install-apache2-module

There will be a screen which takes you further. If there are any dependencies that are needed then it will be asked for on this screen.

After successful installation there is just one thing left, we need to copy some lines to the Apache2 main config file , open the file “apache2.conf” in a text editor and then paste these lines at the end of the file:
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-1.0.4/ext/apache2/mod_passenger.so
RailsSpawnServer /usr/lib/ruby/gems/1.8/gems/passenger-1.0.4/bin/passenger-spawn-server
RailsRuby /usr/bin/ruby1.8

Restart Apache
sudo service apache2 restart

Done!!

Share

Amit Yadav is Stephen Fry proof thanks to caching by WP Super Cache