RailsPlayground
How To use Phusion Passenger

Let’s say your Rails app’s actual directory path is at /home/user1/railsapp/

Enabling Passenger

Edit/Create the public/.htaccess file and place the following lines in it:

RailsBaseURI /
PassengerAppRoot /home/user1/railsapp

Note: If you are using rails 3, use “RackBaseURI” instead of “RailsBaseURI”.

Once enabled, your domain should serve up the Rails app without any issues. If you see a directory listing of your Rails app, then you’ve probably set the domain’s document root as /home/user1/railsapp. Please note that it needs to be /home/user1/railsapp/public or the relevant symlink to it.

Restarting Passenger

Navigate to the Rails app’s root folder and create a file called ‘restart.txt’ within the ‘tmp’ folder:

cd /home/user1/railsapp/
touch tmp/restart.txt

After this, the next website hit to your app will force Passenger to spawn a new instance of your application and kill off any old ones.

Note:

If you’re using Rails 3 with Passenger 3, you might get an error like the following on your site:

“No such file to load — application”

In that case, just replace RailsBaseURI with RackBaseURI in the .htaccess file.

If that still fails, just go the app/controllers folder of your rails application and copy the application_controller.rb file to application.rb
That should fix the issue.