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: dev.myserver.com

Each check-out goes in a seperate subdirectory:
dev.myserver.com/r234 → revision 234 checked out
dev.myserver.com/r235 → 235th revision

And each checked-out version is an app, so it works like this:
dev.myserver.com/r234/controller/action/id

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.

Thanks,
Mike

You can do this several ways with Apache. Here’s how you do it with
fastcgi
(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
-initial-env
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
works
fine.