Archive for the 'rails' Category
Install Passenger (aka mod_rails) on a Plesk 10 System

On Plesk System it is sometimes a little bit tricky to install extensions which are not supported by Plesk itself.

Here is a way how to install phusion passenger ( aka mod_rails) on a host that is managed using Plesk 10 or greater.

First Step
Install passenger as descriped on Passenger Installation :

  1. gem install passenger
  2. passenger-install-apache2-module

For the second point the gcc c++, curl dev libs, apache dev libs must be installed. Use apt-get (debian based systems) or yast (Suse) etc for installation.

Second Step
You have to add a vhosts file to the configuration of the domain / subdomain:

  • Place it at for the main domain:

    conf/vhost.conf

    or at for subdomains:

    subdomains//conf/vhost.conf

  • Add the following lines given by passenger-install-apache2-module

    LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.7/ext/apache2/mod_passenger.so
    PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.7
    PassengerRuby /usr/bin/ruby

  • Add appropriate user and group for the execution of the webapplication like :

    PassengerDefaultGroup psaserv
    PassengerDefaultUser

    The default setting is nobody/nobody which does not work in general.

  • Change the Rails Environment:
    The default is production. If yout test or development add the following line:

    RailsEnv development (resp. test)

Third Step
Change the document root to the public directory of the rails application.
In Plesk 10 you can do this here:
Go to Control Panel der Domain/Subdomain => Websites&Domain

Attention
passenger-install-apache2-module and the original docs give you another setting for the vhost:


AllowOverride all # <-- relax Apache security settings
Options -MultiViews # <-- MultiViews must be turned off

This does not work with plesk! It results in the following error messages:
Syntax error on line xx of /srv/www/vhosts/xxx/subdomains/yyy/conf/vhost.conf: Illegal override option #
Syntax error on line xx of /srv/www/vhosts/xxx/subdomains/yyy/conf/vhost.conf: Illegal option #

This setting was succesfully installed on a Strato based Linux system.