• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Install Ruby on Rails on Plesk?

M

mcahill

Guest
Are there any special procedures I should know of for installing Ruby on Rails with a Plesk-powered server? My main concern is that of FastCGI because I have no idea if Plesk already has FastCGI implemented or if I'm going to have to install it myself.

Thanks!
 
I was going to ask the same question. Any advice from the gurus? I'd like to integrate it with apache/plesk.
 
I set up Rails on a RHEL3 plesk server last month. It's running like a charm so far -- but there are a few gotchas. Here they are, as best I can remember:

1. Red Hat's latest Ruby rpms for RHEL3 are v1.6, and Rails requires v1.8. Unless you want to find RPMs from somewhere else (or you're lucky enough to be using an os that includes ruby 1.8 by default), you'll have to compile Ruby yourself.

2. Neither Red Hat nor Plesk seem to support FastCGI, so you'll have to compile that yourself, too.

3. Ruby doesn't have anything like php's safe_mode and open_basedir restrictions, which means that running rails sites with suexec is a MUST. However, if you've configured FastCGI to use suexec and you don't have cgi-bin enabled for the domains you're running your rails apps in, plesk doesn't include the SuexecUserGroup directive in the domain configuration. That causes suexec to think it's supposed to run your rails app as "nobody", which causes it to spit out the dreaded "Premature end of script headers" error. I spent hours troubleshooting that one.

4. Once you've installed and configured mod_fastcgi for apache, you also have to install fastcgi bindings for ruby. If you use rubygems to do this (you should), you'll need to change Rails' default dispatch.fcgi to 'require_gem "fcgi"' instead of 'require "fcgi"'. I forget the exact spot you have to make that change, but it's easy to find on the Rails wiki (http://wiki.rubyonrails.com/).

5. When you want to set up a rails app on a domain, the app should go in "domainname.com/rails/" or something like that. Then, remove httpdocs and ln -s rails/public httpdocs. I haven't yet figured out how to do this without ssh, so you either have to give your clients ssh or you have to set up their rails apps for them.

Hmm... that's all I can think of at the moment. If y'all would find a howto post helpful, I could probably write out the whole process step-by-step.

Tyler
 
A step-by-step would be a godsend. Thank you so much for figuring out how to make it work!
 
Thanks for blazing the trail - maybe the guy at ART can build some newer rpms for ruby.
 
tyler : i tried to post directly on your site but i dont think it worked.

In reference to part 2 of your guide, Desnt step 3 however give the user pretty much unlimited diskspace as plesk itself only checks key directories for space usage.

`rails` would not be considered one of these directories and the public directory is tiny as all the main files are stored in directories parallel to this?

Is there not anyway that mod_rewrite can be used to simply move the requests to the correct directory

I have the following in .htaccess in httpdocs which works well for the initial request:

RewriteEngine On
RewriteCond %{REQUEST_URI} !(.*)public(.*)
RewriteRule (.*) /APPNAME/public/$1 [P]


However as soon as you click on a link you end up with http://domain/APPNAME/public/XXX

in the url - anybody know how to rewrite the mod_rewrite in dispath.fcgi so that the proxying could be continued to avoid messing with symlinks and putting files outside of normal directories?
 
Hoping your Rails on Plesk document is back up soon! Tried to go to the site but o luck tyler.
 
Ya I'm not sure what happened to that doc, but it would be wonderful to have. Looks like his whole site is down right now.

Miles
 
I have rails installed and working but it seems very slow. I am trying to get Fast CGI working and I have this as my /etc/httpd/conf.d/fastcgi.conf file:

User apache
Group apache

LoadModule fastcgi_module modules/mod_fastcgi.so
<ifmodule mod_fastcgi.c>
FastCgiWrapper on
FastCgiConfig -idle-timeout 300 -maxProcesses 10
FastCgiIpcDir /tmp/fastcgi_ipc/
AddHandler fastcgi-script .fcgi .rb
FastCgiServer /home/httpd/vhosts/quotesandcomments.com/rails_app/public/dispatch.fcgi -idle-timeout 300
</ifmodule>

This setup comes from http://blog.quimble.com/?p=43 rather than from http://wiki.rubyonrails.com/rails/pages/HowtoInstallAndRunRubyOnRailsOnPlesk where that setup would not even let me restart apache.

Anybody have a clue here? I am dying to get rails sped up.

I am running Linux Plesk 7.5.2 Red Hat Enterprise 3. Ruby 1.8.2 and Rails 1.0.

Again, rails is working but it is slow.

Thanks.
 
For my rails installation I used mod_ruby. At the moment it seems very fast.
It can be downloaded at modruby.net

ciao
Beam
 
Back
Top