Forum: Ruby on Rails How do you run a rail app from a subdirectory?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Eb4ffc850ae4f13e7e5602b53fe49772?d=identicon&s=25 Mike Nicholaides (Guest)
on 2006-04-20 15:35
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'   ->  <a href="/r234/mycont">...</a>

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

6ef8cb7cd7cd58077f0b57e4fa49a969?d=identicon&s=25 Brian Hogan (Guest)
on 2006-04-20 16:28
(Received via mailing list)
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 "<h2>Application error</h2>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 topic is locked and can not be replied to.