Ruby on Rails on Media Temple’s (dv) on Plesk on…
So I’ve been fiddling around with trying to get my rails applications installed on Media Temple’s (dv) 3 server. It’s a pretty nice setup; basically a dedicated server (though virtual) that you can play around with to your heart’s content.
While they “support” Plesk 8.1 which in turn supports ruby on rails, they do not offer support for ruby on rails installation. Since I’m a pretty hardcore CS guy, I don’t mind learning stuff. It is easier when there’s support people to help you though.
At first I had tried using rails with fastcgi, but that’s apparently a bad idea. The dv supports fcgid anyway. Media Temple’s support told me it was already installed, but guess what? It wasn’t. I had to go into plesk and get the updater to install it.
I’ve been trying to get my apps to run for more than a week now. I’ve been working on it in my free time, and I finally got one of them to actually start doing something. There were a bunch of hurdles I had to jump over just to get it to work.
Here’s the last thing I needed to do:
I was getting some “Application error: Rails application failed to start properly” errors. The rails log wasn’t too helpful. The httpd one wasn’t either. I looked in the /var/log/httpd/suexec_log file and it said stuff like:
[2007-01-30 15:36:58]: file is writable by others: (/var/www/…/public/dispatch.fcgi)
I thought, “well okay, it's just a warning.” Who cares if it's group writable? After doing some other random stuff, and changing the permissions accidentally, I got this:
[2007-01-30 15:32:30]: file has no execute permission: (/var/www/…/public/dispatch.fcgi)
Okay, so now it’s complaining that it has no execute permission. Whoops. I chmodded it to something like 775 and I get the “file is writable by others” thing again, along with the application error. So I thought, “what the heck” and chmodded the file to a safer 755. It seems that did the job, so now I can execute the app!
I never knew that apache (or suexec or fcgid or whatever the heck is running dispatch.fcgi) really cared so much about permissions. I’ll have to be more thoughtful of logfiles from now on…