Add something new to Virb:

Virb

Are you sure you want to delete that?

or Cancel

 

So this has been a frustrating journey, but I finally got ruby on rails to work on my (dv) box at MediaTemple.

First you need to follow the first part of this guide http://kb.mediatemple.net/questions/279/ ,Stop when it comes to installing Mongrels.

You will first need to install the Passenger Gem:

sudo gem install passenger

This will guide you through the install process and will instruct you to add the following to your /etc/httpd/conf/httpd.conf file

LoadModule passenger_module /usr/local/rubygems/gems/gems/passenger-2.0.6/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/rubygems/gems/gems/passenger-2.0.6
PassengerRuby /usr/local/bin/ruby

I added mine to the end of the LoadModule list, next you need to setup your Virtual Host. At the end of the install, it will guide you to added a new vhost to that same httpd.conf file, simply add it at the end of the file


  ServerName domain.com
  DocumentRoot "/var/www/vhosts/domain.com/httpdocs/railsapp/public"

now we have to configure our vhost file for that domain

nano /var/www/vhosts/domain.com/conf/vhost.conf

That will create the file “vhost.conf”, and similar to our vhost setup in httpd.conf we will add the following lines

ServerName miadb.com DocumentRoot “/var/www/vhosts/miadb.com/httpdocs/rails/public”

No VirtualHost Tags needed, this is so Plesk can recognize the vhost. Now we need to update Plesk with the following command

sudo /usr/local/psa/admin/sbin/websrvmng -a

and then finally, restart apache

sudo /etc/init.d/httpd restart

You can now navigate to your rails app and check to make sure it’s running

cd /var/www/domain.com/httpdocs/railsapp/

Then run

sudo passenger-status

If passenger and your vhosts are properly configured, you should see

----------- General information -----------
 max      = 6
 count    = 1
 active   = 0
 inactive = 1
 Using global queue: no
 Waiting on global queue: 0

----------- Applications -----------
/var/www/vhosts/domain.com/httpdocs/railsapp: 
  PID: 6091      Sessions: 0

Note: You should go to yourdomain.com to make sure vhost is working and that you can view your app, this will also insure passenger is running before you check passenger status, otherwise it may not show up under –Applications–

I hope this helps anyone that had the same problem I had!

Loading comments...

Likes

Details

Via Stephen Korecky

Viewed 33 times

© 2009 Stephen

virb.com/t/2107679
tweet!

Flag this text post!

Flag this text post as:

or Cancel

 

Advertisement

Flag this profile!

Flag this profile as:

or Cancel