For the past few years we have been using fastcgid to deliver rails content. This was not ideal. Last night we turned off fastcgid and switched rails to Passenger (aka mod_rails or mod_rake). All rails apps on AmbitiousLemon are now being served via Passenger (an apache module).
Deploying a Rails webapp will remain the same as before. You will need to create a symlink (aka alias or shortcut) pointing to your rails app’s public directory. You can set this up however you like; with your app accessible from a subURI (mydomain.com/myrailsapp/) or accessible from the root (mydomain.com).
Directions for Deploying to the Root:
- First you need to rename the existing public_html directory to something different (like public_html.old) This command looks like this:
mv public_html public_html.old
- Create an alias of public_html that points to your app/public directory. The command to create the alias (symlink) looks like this (where “app” is the name of the directory housing your rails app):
ln -s ~/app/public ~/public_html
- Next you need to move the web statistics directory out of the old public_html directory into your rail app’s public directory:
mv public_html.old/stats ~/public_html/stats
Directions for Deploying to a Sub URI:
- Create a shortcut of myfabulouswebapp (or anything you want) that points to your myfabulouswebapp/public directory. The command to create the shortcut (symlink) looks like this (where “myfabulouswebapp” is the name of the directory housing your rails app):
ln -s ~/myfabulouswebapp/public ~/public_html
How to restart your Rails App:
Create or modify the file tmp/restart.txt in the Rails application’s root folder. Passenger will automatically restart the application.
For example, to restart the example myfabulouswebapp application, we type this in the command line:
touch myfabulouswebapp/tmp/restart.txt
You can find more information about how to use Passenger to better manage your rails applications by reading the Passenger
User Guide.