Rails Passenger Staging environment problem in Dreamhost

Problem
You want to deploy your rails application using Passenger in Dreamhost, but on a staging environment. It doesn’t work just changing your Capistrano recipe or your environment files, as the default environment for passenger is ‘production’.

Solution
Looking at the Passenger documentation here, there are four different ways of achieving that by changing the RailsEnv option. If you don’t want to change the Apache configuration files, and as long as the option AllowOverride is on (which should be on Dreamhost), then you would need to create an .htaccess file in your application’s public folder with the following:

RailsEnv staging

Phusion Passenger installation in Mandriva 2009

Problem
You have recently installed Mandriva 2009 and you want to install phusion passenger.

Solution

  1. First make sure that apache is installed. If it is not installed (default), do:
    urpmi apache

    On the selection question about the dependencies select option 1 (apache-prefork)

  2. Use the details from the phusion passenger website. ie:
    Install passenger:

    gem install passenger
  3. Run the passenger installation:
    passenger-install-apache2-module
  4. If at the second stage of the installation the installer complains that GNU C++ compiler … not found, install the gnu c++ compiler, with:
    urpmi gcc_c++
  5. Run the passenger installation (step 3) again. If at this stage the installer complains that Apache 2 development headers … not found, use:
    urpmi apache-devel
  6. Run passenger installer (step 3), once more. Now everything should be ok and the apache 2 module will be installed when the installer finishes.
  7. Restart the Apache webserver, and you should be able to add your Rails application. Use the following to deploy your application in /somewhere/public:
    <VirtualHost *:80>
      ServerName www.yourhost.com
      DocumentRoot /somewhere/public
    </VirtualHost>