User Tools

Site Tools


ruby:rails:mod_rails

Passenger

More information about Passenger (aka. mod_rails for Apache) can be found here.

Installation

Install Passenger gem

gem install passenger

Run the installer

Execute the installation script and follow the instructions:

passenger-install-apache2-module

If you are using ruby enterprise edition make sure you use the right path:

/opt/ruby-enterprise-<version>/bin/passenger-install-apache2-module
Using ruby enterprise edition also make sure you use the right path to install gems, i.e. /opt/ruby-enterprise-1.8.6-20090201/bin/gem update
If you encounter any problems, please read the Users guide for troubleshooting tips.

Configure Apache

  • Create the following configuration in conf.d/mod_rails.conf:
# Configuration for mod_rails http://www.modrails.com
# to run RubyOnRails applications within apache
LoadModule passenger_module /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod_passenger.so
PassengerRoot /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/passenger-2.2.2
PassengerRuby /opt/ruby-enterprise-1.8.6-20090201/bin/ruby
  • Create a VirtualHost within apache for your application:
<VirtualHost *:80>
  ServerName example.com
  DocumentRoot /srv/www/example/htdocs/public
  ErrorLog logs/example-errors_log
  CustomLog logs/example-access_log combine
  <Directory /srv/www/example/htdocs/public>
    Allow from all
    AllowOverride None
  </Directory>
</VirtualHost>

Restart apache

Restart apache and your done!

service httpd restart
/srv/wiki.niwos.com/data/pages/ruby/rails/mod_rails.txt · Last modified: 2012/10/27 11:27 by niwo