RE: Running apps in subdirectories using lighty/scgi

For this I had to

  1. load the alias module
  2. define it to use the alias
  3. switch the default error handler to use that alias
  4. change my rails app to set the relative_uri_root

put this at the end of environment.rb

ActionController::AbstractRequest.relative_url_root = “/=tango”

$HTTP[“url”] =~ “^/tango/” {
alias.url = ( “/tango/” => “/home/tango/public/” )
server.document-root = “/home/tango/public/”
static-file.exclude-extensions = ( “.fcgi”, “.scgi” )
server.error-handler-404 = “/tango/dispatch.scgi”
server.indexfiles = ( “dispatch.fcgi”, “index.html” )

scgi.server = (
“dispatch.scgi” =>
( “127.0.0.1” =>
(
“host” => “127.0.0.1”,
“port” => 9999,
“check-local” => “disable”
)
)
)
scgi.debug=0
}

Let me know if that helps you. Untested ,but it’s from my working setup.
Be sure you enable mod_alias!!!)

I tried you configuration, and when requesting “/tango/” I get a 403,
when requesting “/tango/fruit/” I get a 404.

On the Rails log there are entries for both requests with a
RoutingError: -Recognition failed for “”-, and -Recognition failed for
“fruit”-, respectively.

Ivan V.

Hogan, Brian P.
escribió:> For this I had to

OH MY GOD! I’m going to cry…

I finally did it!

ActionController::AbstractRequest.relative_url_root = “/tango”

$HTTP[“url”] =~ “^/tango/” {
alias.url = ( “/tango/” => “/home/tango/public/” )
server.error-handler-404 = “/tango/dispatch.scgi”
scgi.server = (
“/tango/dispatch.scgi” =>
( “127.0.0.1” =>
(
“host” => “127.0.0.1”,
“port” => 9999,
“check-local” => “disable”
)
)
)
}

Thanks!

Ivan V.

Hogan, Brian P.
escribió:> For this I had to