Post Reply 
mod_rails and ispCPOmega
Author Message
samducker Offline
Junior Member
*

Posts: 24
Joined: Apr 2008
Reputation: 0
Post: #1
mod_rails and ispCPOmega
Can I get rails via mod_rails or any other method to work while using ispCPOmega
08-11-2008 08:33 AM
Find all posts by this user Quote this message in a reply
gOOvER Offline
Documentation Team
***
Docu Team

Posts: 1,658
Joined: Jul 2007
Reputation: 15
Post: #2
RE: mod_rails and ispCPOmega
I think it's possible. You have to try it.

Server : Rootserver
OS : Debian 4.0 Etch 64bit
ispCP Version : r1399 - 20.11.08 (NightlyBuild)
Activated : AWStats dynamic
Mods : update via NightlyUpdateScript
08-11-2008 03:07 PM
Visit this user's website Find all posts by this user Quote this message in a reply
kilburn Offline
Junior Member
*

Posts: 154
Joined: Feb 2007
Reputation: 5
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
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


| All rights reserved : isp-control.net |