Thursday, April 15, 2010

Configure staging environment for Phusion Passenger.!

Please follow step-by-step success is your's : LOL

Copy production.rb to staging.rb in config/environments
cd /app/config/environments/
cp production.rb staging.rb

Add a staging entry to your config/database.yml
Your database.yml is should like this :

adapter: mysql
reconnect: false
database: databae_staging
username: root
password: password
host: localhost
socket: /var/lib/mysql/mysql.sock

Add log file for staging env.
cd log/
touch staging.log
chmod 0666 log/staging.log

For just check. if the env is working for staging.
ruby script/server -e staging

For The Phusion Passenger (mod_rails) You have to put "RailsEnv staging" in your Apache Virtual Host.

Like this:

< virtualhost XX.XX.XX.XX:80 >

RailsEnv staging
< /VirtualHost >

restart apache
and check website.