Ubuntu Hardy - mod_rails Installation
Phusion's Passenger (mod_rails) is an exciting development in serving your Ruby on Rails application with the Apache web server.
Simple to install and use, you can have a Rails application up and running quickly. You don't have to worry about ports or setting up a proxy to another server.
This article assumes that you have the following items already installed:
- Apache (see Ubuntu Hardy - Apache and PHP install)
- Ruby and RubyGems (see Ubuntu Hardy - Ruby on Rails)
Passenger (mod_rails) is a RubyGem.
First, you have to update the RubyGems installation, as follows:
sudo gem update
Then, install Passenger:
sudo gem install passenger
After Passenger is installed, install the Passenger Apache2 module:
A dialog box opens in the terminal and starts with the following information:
Press Enter/Return. The following information appears:
The installer has found a missing dependency, the Apache headers.
Press Enter/Return. The installer provides instructions for installing the headers:
The installation completes with instructions telling you to add some lines to the main Apache 2 configuration file.
Run the following command:
sudo nano /etc/apache2/apache2.conf
Note: Passenger is an active gem and is being updated all the time. Instead of copying and pasting the following output, copy and paste the output from the installation itself.
At the time of the most recent update to this article, Passenger v4.0.33 was the current version. So, for the v4.0.33 installation, add the following lines to the apache2.conf file:
LoadModule passenger_module /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.33/buildout/apache2/mod_passenger.so
The last step is to restart Apache, as follows:
sudo /etc/init.d/apache2 restart
That's all you need to do to install mod_rails on your Cloud Server. The next article Ubuntu Hardy - using mod_rails to serve your application, describes how to create a Ruby on Rails application and serve it using Passenger.
© 2011-2013 Rackspace US, Inc.
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License
See license specifics and DISCLAIMER