Forum: Ruby on Rails RE: Running apps in subdirectories using lighty/scgi

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
60e38de043848f82392062088f191213?d=identicon&s=25 Hogan, Brian P. (Guest)
on 2006-02-23 18:28
(Received via mailing list)
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!!!)
C5380b957ff8ce5cb14cf2282ffeb720?d=identicon&s=25 Iván Vega Rivera (Guest)
on 2006-02-23 18:49
(Received via mailing list)
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
C5380b957ff8ce5cb14cf2282ffeb720?d=identicon&s=25 Iván Vega Rivera (Guest)
on 2006-02-23 22:00
(Received via mailing list)
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
This topic is locked and can not be replied to.