Enabling Ruby on Rails support for a domain in Plesk

If you have Plesk 8.1 or later, you have support available for Ruby on Rails. Unfortunately, clicking the FastCGI checkbox in Plesk won't get you all of the support you need (and expect). The folks over at Parallels created a relatively simple process to get Ruby on Rails working properly on your site:

Go to your domain that you want to adjust, and click Setup. Make sure the CGI and FastCGI options are enabled. Pick a name for your application and make the directory for your application in the httpdocs directory. Upload your files to that directory.

Once you've done that, create an .htaccess file in the httpdocs directory with the following text inside:

RewriteEngine On
RewriteRule ^$ /public/index.html [L]
RewriteCond % !^/railsapp/public
RewriteRule ^(.*)$ /public/$1 [L]
RewriteCond % !-f
RewriteRule ^(.*)$ public/dispatch.fcgi/$1 [QSA,L]

Remove the .htaccess file within the public directory of your application and add a file called dispatch.fcgi to that directory which contains:

#!/usr/bin/ruby

You should be able to access your application at http://domain.com/railsapp/.

Printed from: http://rackerhacker.com/2008/08/11/enabling-ruby-on-rails-support-for-a-domain-in-plesk/ .
© Major Hayden 2012.

1 Comment   »

  • I've found the ruby support to be very lacking (or I am missing something). How are you handling installing add-ons, gems, etc? I've often had to re-map ruby to a new directory and install later versions to get the support the clients want.

Trackbacks/Pingbacks

  1. Kresnadi T. Budisantoso» Blogarchiv » Plesk und Ruby on Rails
  2. Kodingen.com — Blog — Get Ruby working

RSS feed for comments on this post

Leave a Reply

 

  • Welcome! I started this blog as a way to give back to all of the other system administrators who have taught me something in the past. Writing these posts brings me a lot of enjoyment and I hope you find the information useful. If you spot something that's incorrect or confusing, please write a comment and let me know. Drop me a line if there's something you want to know more about and I'll do my best to write a post on the topic.
    -- Major Hayden

    Flattr this