Debian lenny fastcgi+rails mini-howto
As fastcgi is already enabled by default in ispcp and fastcgi+rails gives a decent performance (see
this benchmark where this setup gets the 2nd place) I've deciced to give it a try:
1. Install required packages:
Code:
apt-get install libmysql-ruby ruby ri rdoc irb libreadline-ruby libruby libopenssl-ruby libsqlite-ruby libfcgi-ruby1.8 rubygems
2. Install the rails framework
Code:
gem install rails --include-dependencies
3. Upload your rails app to the home of the desired domain (ie: /var/www/virtual/domain.tld/)
Code:
/var/www/virtual/domain.tld
/railsapp1
/config
/app
...
/railsapp2
/config
/app
...
4. Remove the htdocs folder and symlink it to the public folder of the default app (don't do it if you don't want a rails app as default page)
Code:
cd /var/www/virtual/domain.tld
rm -rf htdocs
ln -s railsapp1/public htdocs
5. Symlink any other rails app public folder to the apropiate location
Code:
cd /var/www/virtual/domain.tld
ln -s railsapp2/public htdocs/railsapp2
6. Write an htaccess to redirect requests to the dispatcher.fcgi file
/var/www/domain.tld/htdocs/.htaccess:
Code:
RewriteEngine On
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
This worked for me, hope it helps others