Iván Vega Rivera
2006-Feb-23 16:52 UTC
[Rails] Running apps in subdirectories using lighty/scgi
Hi, So thanks to Zed I was able to get lighty/scgi and a Rails app running. I know this might not be the best place to post this, but I guessed there may be several others with similar experiences here. So, the following step is to have several apps each in its on subdirectory. I tried the following to no avail: $HTTP["url"] =~ "^/tango/" { server.document-root = "/home/tango/public/" server.error-handler-404 = "/dispatch.scgi" scgi.server = ( "/dispatch.scgi" => ( "127.0.0.1" => ( "host" => "127.0.0.1", "port" => 9999, "check-local" => "disable" ) ) ) } But all I get is a 404. Running scgi_monitor shows that in fact, requests to anything in or below /tango/ is getting handled by SCGI. So it would seem that SCGI isn''t finding the Rails app? Regards, Ivan V. PS: This is fun!
Iván Vega Rivera
2006-Feb-23 17:18 UTC
[Rails] Running apps in subdirectories using lighty/scgi
It seems that Rails is getting a request for /tango/... which it doesn''t recognize... hmmm... How could I remove /tango/ from the URI Rails gets? Iv?n Vega Rivera escribi?:> Hi, > > So thanks to Zed I was able to get lighty/scgi and a Rails app running. > > I know this might not be the best place to post this, but I guessed > there may be several others with similar experiences here. > > So, the following step is to have several apps each in its on > subdirectory. I tried the following to no avail: > > $HTTP["url"] =~ "^/tango/" { > server.document-root = "/home/tango/public/" > server.error-handler-404 = "/dispatch.scgi" > scgi.server = ( > "/dispatch.scgi" => > ( "127.0.0.1" => > ( > "host" => "127.0.0.1", > "port" => 9999, > "check-local" => "disable" > ) > ) > ) > } > > But all I get is a 404. Running scgi_monitor shows that in fact, > requests to anything in or below /tango/ is getting handled by SCGI. > So it would seem that SCGI isn''t finding the Rails app? > > Regards, > Ivan V. > > PS: This is fun! > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Hogan, Brian P.
2006-Feb-23 17:26 UTC
[Rails] 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!!!) -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Iv?n Vega Rivera Sent: Thursday, February 23, 2006 11:20 AM To: rails@lists.rubyonrails.org Subject: Re: [Rails] Running apps in subdirectories using lighty/scgi It seems that Rails is getting a request for /tango/... which it doesn''t recognize... hmmm... How could I remove /tango/ from the URI Rails gets? Iv?n Vega Rivera escribi?:> Hi, > > So thanks to Zed I was able to get lighty/scgi and a Rails app > running. > > I know this might not be the best place to post this, but I guessed > there may be several others with similar experiences here. > > So, the following step is to have several apps each in its on > subdirectory. I tried the following to no avail: > > $HTTP["url"] =~ "^/tango/" { > server.document-root = "/home/tango/public/" > server.error-handler-404 = "/dispatch.scgi" scgi.server = ( > "/dispatch.scgi" => > ( "127.0.0.1" => > ( > "host" => "127.0.0.1", > "port" => 9999, > "check-local" => "disable" > ) > ) > ) > } > > But all I get is a 404. Running scgi_monitor shows that in fact, > requests to anything in or below /tango/ is getting handled by SCGI. > So it would seem that SCGI isn''t finding the Rails app? > > Regards, > Ivan V. > > PS: This is fun! > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails
Iván Vega Rivera
2006-Feb-23 17:46 UTC
[Rails] Running apps in subdirectories using lighty/scgi
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 > 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!!!) > > > -----Original Message----- > From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Iv?n Vega Rivera > Sent: Thursday, February 23, 2006 11:20 AM > To: rails@lists.rubyonrails.org > Subject: Re: [Rails] Running apps in subdirectories using lighty/scgi > > > It seems that Rails is getting a request for /tango/... which it doesn''t > recognize... hmmm... How could I remove /tango/ from the URI Rails gets? > > Iv?n Vega Rivera escribi?: > >> Hi, >> >> So thanks to Zed I was able to get lighty/scgi and a Rails app >> running. >> >> I know this might not be the best place to post this, but I guessed >> there may be several others with similar experiences here. >> >> So, the following step is to have several apps each in its on >> subdirectory. I tried the following to no avail: >> >> $HTTP["url"] =~ "^/tango/" { >> server.document-root = "/home/tango/public/" >> server.error-handler-404 = "/dispatch.scgi" scgi.server = ( >> "/dispatch.scgi" => >> ( "127.0.0.1" => >> ( >> "host" => "127.0.0.1", >> "port" => 9999, >> "check-local" => "disable" >> ) >> ) >> ) >> } >> >> But all I get is a 404. Running scgi_monitor shows that in fact, >> requests to anything in or below /tango/ is getting handled by SCGI. >> So it would seem that SCGI isn''t finding the Rails app? >> >> Regards, >> Ivan V. >> >> PS: This is fun! >> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >
Iván Vega Rivera
2006-Feb-23 20:59 UTC
[Rails] Running apps in subdirectories using lighty/scgi
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 > 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!!!) > > > -----Original Message----- > From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Iv?n Vega Rivera > Sent: Thursday, February 23, 2006 11:20 AM > To: rails@lists.rubyonrails.org > Subject: Re: [Rails] Running apps in subdirectories using lighty/scgi > > > It seems that Rails is getting a request for /tango/... which it doesn''t > recognize... hmmm... How could I remove /tango/ from the URI Rails gets? > > Iv?n Vega Rivera escribi?: > >> Hi, >> >> So thanks to Zed I was able to get lighty/scgi and a Rails app >> running. >> >> I know this might not be the best place to post this, but I guessed >> there may be several others with similar experiences here. >> >> So, the following step is to have several apps each in its on >> subdirectory. I tried the following to no avail: >> >> $HTTP["url"] =~ "^/tango/" { >> server.document-root = "/home/tango/public/" >> server.error-handler-404 = "/dispatch.scgi" scgi.server = ( >> "/dispatch.scgi" => >> ( "127.0.0.1" => >> ( >> "host" => "127.0.0.1", >> "port" => 9999, >> "check-local" => "disable" >> ) >> ) >> ) >> } >> >> But all I get is a 404. Running scgi_monitor shows that in fact, >> requests to anything in or below /tango/ is getting handled by SCGI. >> So it would seem that SCGI isn''t finding the Rails app? >> >> Regards, >> Ivan V. >> >> PS: This is fun! >> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >
Hogan, Brian P.
2006-Feb-24 14:48 UTC
[Rails] Running apps in subdirectories using lighty/scgi
Awesome :) -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Iv?n Vega Rivera Sent: Thursday, February 23, 2006 3:01 PM To: rails@lists.rubyonrails.org Subject: Re: [Rails] Running apps in subdirectories using lighty/scgi 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 > 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!!!) > > > -----Original Message----- > From: rails-bounces@lists.rubyonrails.org > [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Iv?n Vega Rivera > Sent: Thursday, February 23, 2006 11:20 AM > To: rails@lists.rubyonrails.org > Subject: Re: [Rails] Running apps in subdirectories using lighty/scgi > > > It seems that Rails is getting a request for /tango/... which it > doesn''t > recognize... hmmm... How could I remove /tango/ from the URI Rails gets? > > Iv?n Vega Rivera escribi?: > >> Hi, >> >> So thanks to Zed I was able to get lighty/scgi and a Rails app >> running. >> >> I know this might not be the best place to post this, but I guessed >> there may be several others with similar experiences here. >> >> So, the following step is to have several apps each in its on >> subdirectory. I tried the following to no avail: >> >> $HTTP["url"] =~ "^/tango/" { >> server.document-root = "/home/tango/public/" >> server.error-handler-404 = "/dispatch.scgi" scgi.server = ( >> "/dispatch.scgi" => >> ( "127.0.0.1" => >> ( >> "host" => "127.0.0.1", >> "port" => 9999, >> "check-local" => "disable" >> ) >> ) >> ) >> } >> >> But all I get is a 404. Running scgi_monitor shows that in fact, >> requests to anything in or below /tango/ is getting handled by SCGI. >> So it would seem that SCGI isn''t finding the Rails app? >> >> Regards, >> Ivan V. >> >> PS: This is fun! >> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >_______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails