How do you run a rail app from a subdirectory?

I’ve looked everywhere and I haven’t been able to find a solution. I’m
running Apache and I have an app under version control (svn). I want to
be able to have multiple check-outs on one server, and I don’t have to
modify httpd.conf every time I do.

Basically, I envisioned that it would work like this:

There’s a development server:

Each check-out goes in a seperate subdirectory: -> revision 234 checked out -> 235th revision

And each checked-out version is an app, so it works like this:

And the paths from link_to and javascript_include_tag are set right
link_to :controller=>‘mycontr’ ->

So, it there a way to do this? I’ve done a few rails apps, but never
done something like this.


You can do this several ways with Apache. Here’s how you do it with
(assuming you have that set up)

Add this to the end of httpd.conf (ensure you’ve enabled mod_alias!)

Alias /test “c:/rails/test/public”

FastCgiServer c:/rails/test/public/dispatch.fcgi -idle-timeout 120
RAILS_ENV=production -processes 2

<Directory c:/rails/test/public>

Options ExecCGI FollowSymlinks

AllowOverride All

And uncomment the RewriteBase line in your .htaccess file for the
corresponding rails app

AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI

RewriteEngine On
RewriteBase /test
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

ErrorDocument 500 “

Application error

Rails application failed to
start properly”

Then just repeat that for each app.

This example is for Windows but just change the paths for Linux and it

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs