Current time: 05-17-2024, 10:50 PM Hello There, Guest! (LoginRegister)


Post Reply 
mod_rails and ispCPOmega
Author Message
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #3
RE: mod_rails and ispCPOmega
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 Smile
08-12-2008 07:04 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
mod_rails and ispCPOmega - samducker - 08-11-2008, 08:33 AM
RE: mod_rails and ispCPOmega - gOOvER - 08-11-2008, 03:07 PM
RE: mod_rails and ispCPOmega - kilburn - 08-12-2008 07:04 PM
RE: mod_rails and ispCPOmega - blub - 03-29-2010, 04:42 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)