It''s actually REALLY easy with lighttpd on linux. Two apps... Myserver.com/code/ => /apps/code/ Myserver.com/test/ +> /apps/test/ Each application needs this in the environment.rb /apps/code/config/environment.rb ActionController::AbstractRequest.relative_url_root = "/code" /apps/test/config/environment.rb ActionController::AbstractRequest.relative_url_root = "/test" Here''s a lighttpd config file that runs on port 80. Be sure to activate mod_alias!! # Default configuration file for the lighttpd web server # Start using ./script/server lighttpd server.port = 80 server.modules = ("mod_alias", "mod_rewrite", "mod_accesslog", "mod_fastcgi" ) server.document-root = "/apps/root/" url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "$1.html" ) $HTTP["url"] =~ "^/code" { server.document-root = "/apps/code/public/" alias.url = ( "/code" => "/apps/code/public" ) server.error-handler-404 = "/code/dispatch.fcgi" server.errorlog = "/apps/code/log/lighttpd.error.log" accesslog.filename = "/apps/code/log/lighttpd.access.log" server.indexfiles = ( "dispatch.fcgi", "index.html" ) fastcgi.server = ( ".fcgi" => (( "socket" => "/apps/code/log/code.socket", "min-procs" => 2, "max-procs" => 2, "bin-path" => "/apps/code/public/dispatch.fcgi", "bin-environment" => ( "RAILS_ENV" => "production" ) ))) } $HTTP["url"] =~ "^/test" { server.document-root = "/apps/test/public/" alias.url = ( "/test" => "/apps/test/public" ) server.error-handler-404 = "/test/dispatch.fcgi" server.errorlog = "/apps/test/log/lighttpd.error.log" accesslog.filename = "/apps/test/log/lighttpd.access.log" server.indexfiles = ( "dispatch.fcgi", "index.html" ) fastcgi.server = ( ".fcgi" => (( "socket" => "/apps/test/log/test.socket", "min-procs" => 2, "max-procs" => 2, "bin-path" => "/apps/test/public/dispatch.fcgi", "bin-environment" => ( "RAILS_ENV" => "production" ) ))) } mimetype.assign = ( ".css" => "text/css", ".gif" => "image/gif", ".htm" => "text/html", ".html" => "text/html", ".jpeg" => "image/jpeg", ".jpg" => "image/jpeg", ".js" => "text/javascript", ".png" => "image/png", ".swf" => "application/x-shockwave-flash", ".txt" => "text/plain" ) -------------- Doing this with SCGI is just as easy. Just change the appropriate sections and it should work fine. Good luck!!! -Brian -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Stephen Bannasch Sent: Tuesday, March 07, 2006 1:33 PM To: rails@lists.rubyonrails.org Subject: Re: [Rails] hosting multiple rails apps in one webroot? Thanks Peter, As I read that page virtual hosting maps hostnames => document roots (using server-root, default-host, and document-root) -- there does not appear to be a way to map hostname/path1 to a virtual host. In order to server two different rails apps I assume that I need to create two different fcgi.server blocks in lighttpd.conf however these blocks appear to be differentiated based on hostname and port alone. I can easily map rails.dev.host.com to an fcgi process that starts either the dispatch.fcgi process in railsapp1 or raqilsapp2. If I had more control over the name rails.dev.host.com I could create virtual hosts like this: railsapp1.rails.dev.host.com railsapp2.rails.dev.host.com and then create two virtual hosts and two fcgi-server blocks for both the apps. But I am stuck with rails.dev.host.com Perhaps I am missing something obvious ...?>see that page: >http://www.lighttpd.net/documentation/ > >and search for keywords ''virtual'' and ''host'' > > >> --- Urspr?ngliche Nachricht --- >> Von: Stephen Bannasch <stephen.bannasch@gmail.com> >> An: rails@lists.rubyonrails.org >> Betreff: [Rails] hosting multiple rails apps in one webroot? >> Datum: Tue, 7 Mar 2006 13:45:08 -0500 >> >> Question: >> >> I have lightpd running behind an apache proxy and I would like to >> setup lighttpd so that different folders under webroot are mapped to >> different rails applications. >> >> filesystem view: >> >> webroot/ >> railsapp1/ >> app/ >> config/ >> public/ >> [...] >> railsapp2/ >> app/ >> config/ >> public/ >> [...] >> >> urlview: >> > > rails.dev.host.com/railsapp1 => railsapp1 >> rails.dev.host.com/railsapp2 => railsapp2 >> >> and >> >> rails.dev.host.com => index.html in webroot/ >> >> Thanks >> -- >> - Stephen Bannasch >> Concord Consortium, http://www.concord.org >> _______________________________________________ >> 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-- -- Stephen Bannasch Director of Technology, Concord Consortium 10 Concord Crossing, Suite 300, Concord, MA 01742 direct and fax: 978 405-3209 main: 978 405 3200 http://www.concord.org mailto:stephen@concord.org _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails
Stephen Bannasch
2006-Mar-16 05:32 UTC
[Rails] hosting multiple rails apps in one webroot?
Brian, Your config listed below ALMOST worked ... In the $HTTP["url"] conditional config blocks I had to change: server.error-handler-404 = "/code/dispatch.fcgi" to server.error-handler-404 = "dispatch.fcgi" I''m using lighttpd 1.4.11 on MacOS X 10.4.5. I hadn''t realized how convoluted the process lighttpd uses is in order to get to my rails apps. I enabled lighttpd debugging and carefully watched the error log. When I connect to the url: host.com/railsapp1/controller/method lighttpd first discovers that the file: /Users/stephen/dev/rails/railsapp1/public/controller/method doesn''t exist before connecting to: /Users/stephen/dev/rails/railsapp1/public/dispatch.fcgi and passing in the route: /railsapp1/controller/method Which works because the following param in config/environment.rb (thanks for pointing it out): ActionController::AbstractRequest.relative_url_root = "/railsapp1" gets rails to strip the leading appname before routing. So for anybody else who is interested example here''s the conditional config block for one of my test apps which is accessed via url: host.com/railsapp1 $HTTP["url"] =~ "^/railsapp1" { server.document-root = "/Users/stephen/dev/rails/railsapp1/public/" alias.url = ( "/railsapp1" => "/Users/stephen/dev/rails/railsapp1/public" ) accesslog.filename = "/Users/stephen/dev/rails/railsapp1/log/access.log" server.error-handler-404 = "dispatch.fcgi" server.errorlog = "/Users/stephen/dev/rails/railsapp1/log/lighttpd.error.log" server.indexfiles = ( "dispatch.fcgi", "index.html" ) # rails stuff fastcgi.server = ( ".fcgi" => ( ( "socket" => "/Users/stephen/dev/rails/railsapp1/log/code.socket", "min-procs" => 2, "max-procs" => 2, "bin-path" => "/Users/stephen/dev/rails/railsapp1/public/dispatch.fcgi", "bin-environment" => ( "RAILS_ENV" => "development" ) ))) } Thanks for your suggestion. At 2:16 PM -0600 3/7/06, Hogan, Brian P. wrote:>It''s actually REALLY easy with lighttpd on linux. > >Two apps... > >Myserver.com/code/ => /apps/code/ >Myserver.com/test/ +> /apps/test/ > > > >Each application needs this in the environment.rb > >/apps/code/config/environment.rb > >ActionController::AbstractRequest.relative_url_root = "/code" > >/apps/test/config/environment.rb > >ActionController::AbstractRequest.relative_url_root = "/test" > > > >Here''s a lighttpd config file that runs on port 80. Be sure to activate mod_alias!! > > ># Default configuration file for the lighttpd web server ># Start using ./script/server lighttpd > >server.port = 80 >server.modules = ("mod_alias", "mod_rewrite", "mod_accesslog", "mod_fastcgi" ) >server.document-root = "/apps/root/" >url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "$1.html" ) > >$HTTP["url"] =~ "^/code" { > server.document-root = "/apps/code/public/" > alias.url = ( "/code" => "/apps/code/public" ) > server.error-handler-404 = "/code/dispatch.fcgi" > server.errorlog = "/apps/code/log/lighttpd.error.log" > accesslog.filename = "/apps/code/log/lighttpd.access.log" > server.indexfiles = ( "dispatch.fcgi", "index.html" ) > > fastcgi.server = ( ".fcgi" => > (( > "socket" => "/apps/code/log/code.socket", > "min-procs" => 2, > "max-procs" => 2, > "bin-path" => "/apps/code/public/dispatch.fcgi", > "bin-environment" => ( "RAILS_ENV" => "production" ) > ))) >} > >$HTTP["url"] =~ "^/test" { > server.document-root = "/apps/test/public/" > alias.url = ( "/test" => "/apps/test/public" ) > server.error-handler-404 = "/test/dispatch.fcgi" > server.errorlog = "/apps/test/log/lighttpd.error.log" > accesslog.filename = "/apps/test/log/lighttpd.access.log" > server.indexfiles = ( "dispatch.fcgi", "index.html" ) > > fastcgi.server = ( ".fcgi" => > (( > "socket" => "/apps/test/log/test.socket", > "min-procs" => 2, > "max-procs" => 2, > "bin-path" => "/apps/test/public/dispatch.fcgi", > "bin-environment" => ( "RAILS_ENV" => "production" ) > ))) >} > > > > >mimetype.assign = ( > ".css" => "text/css", > ".gif" => "image/gif", > ".htm" => "text/html", > ".html" => "text/html", > ".jpeg" => "image/jpeg", > ".jpg" => "image/jpeg", > ".js" => "text/javascript", > ".png" => "image/png", > ".swf" => "application/x-shockwave-flash", > ".txt" => "text/plain" >) >-------------- > >Doing this with SCGI is just as easy. Just change the appropriate sections and it should work fine. > >Good luck!!! > >-Brian-- -- Stephen Bannasch Director of Technology, Concord Consortium 10 Concord Crossing, Suite 300, Concord, MA 01742 direct and fax: 978 405-3209 main: 978 405 3200 http://www.concord.org mailto:stephen@concord.org
Stephen, I submitted a small patch the other day: http://dev.rubyonrails.org/ticket/4243 ...that would allow you to specify the relative_url_root in the lighttpd.conf instead of in the environment.rb, like so: fastcgi.server = ( ".fcgi" => ( ( "socket" => "/Users/stephen/dev/rails/railsapp1/log/code.socket", "min-procs" => 2, "max-procs" => 2, "bin-path" => "/Users/stephen/dev/rails/railsapp1/public/dispatch.fcgi", "bin-environment" => ( "RAILS_ENV" => "development", "RAILS_RELATIVE_URL_ROOT" => "/railsapp1" ) ))) } I''d like to also get automatic detection of subdirectories working on lighttpd (like it does on apache), but setting an environment variable is meeting my needs at the moment. - Isaac On 3/16/06, Stephen Bannasch <stephen.bannasch@gmail.com> wrote:> Brian, > > Your config listed below ALMOST worked ... > > In the $HTTP["url"] conditional config blocks I had to change: > server.error-handler-404 = "/code/dispatch.fcgi" > to > server.error-handler-404 = "dispatch.fcgi" > > I''m using lighttpd 1.4.11 on MacOS X 10.4.5. > > I hadn''t realized how convoluted the process lighttpd uses is in order to get to my rails apps. I enabled lighttpd debugging and carefully watched the error log. When I connect to the url: host.com/railsapp1/controller/method lighttpd first discovers that the file: > /Users/stephen/dev/rails/railsapp1/public/controller/method > doesn''t exist before connecting to: > /Users/stephen/dev/rails/railsapp1/public/dispatch.fcgi > and passing in the route: > /railsapp1/controller/method > Which works because the following param in config/environment.rb (thanks for pointing it out): > ActionController::AbstractRequest.relative_url_root = "/railsapp1" > gets rails to strip the leading appname before routing. > > So for anybody else who is interested example here''s the conditional config block for one of my test apps which is accessed via url: host.com/railsapp1 > > $HTTP["url"] =~ "^/railsapp1" { > server.document-root = "/Users/stephen/dev/rails/railsapp1/public/" > alias.url = ( "/railsapp1" => "/Users/stephen/dev/rails/railsapp1/public" ) > accesslog.filename = "/Users/stephen/dev/rails/railsapp1/log/access.log" > server.error-handler-404 = "dispatch.fcgi" > server.errorlog = "/Users/stephen/dev/rails/railsapp1/log/lighttpd.error.log" > server.indexfiles = ( "dispatch.fcgi", "index.html" ) > # rails stuff > fastcgi.server = ( ".fcgi" => > ( > ( > "socket" => "/Users/stephen/dev/rails/railsapp1/log/code.socket", > "min-procs" => 2, > "max-procs" => 2, > "bin-path" => "/Users/stephen/dev/rails/railsapp1/public/dispatch.fcgi", > "bin-environment" => ( "RAILS_ENV" => "development" ) > ))) > } > > Thanks for your suggestion. > > At 2:16 PM -0600 3/7/06, Hogan, Brian P. wrote: > >It''s actually REALLY easy with lighttpd on linux. > > > >Two apps... > > > >Myserver.com/code/ => /apps/code/ > >Myserver.com/test/ +> /apps/test/ > > > > > > > >Each application needs this in the environment.rb > > > >/apps/code/config/environment.rb > > > >ActionController::AbstractRequest.relative_url_root = "/code" > > > >/apps/test/config/environment.rb > > > >ActionController::AbstractRequest.relative_url_root = "/test" > > > > > > > >Here''s a lighttpd config file that runs on port 80. Be sure to activate mod_alias!! > > > > > ># Default configuration file for the lighttpd web server > ># Start using ./script/server lighttpd > > > >server.port = 80 > >server.modules = ("mod_alias", "mod_rewrite", "mod_accesslog", "mod_fastcgi" ) > >server.document-root = "/apps/root/" > >url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "$1.html" ) > > > >$HTTP["url"] =~ "^/code" { > > server.document-root = "/apps/code/public/" > > alias.url = ( "/code" => "/apps/code/public" ) > > server.error-handler-404 = "/code/dispatch.fcgi" > > server.errorlog = "/apps/code/log/lighttpd.error.log" > > accesslog.filename = "/apps/code/log/lighttpd.access.log" > > server.indexfiles = ( "dispatch.fcgi", "index.html" ) > > > > fastcgi.server = ( ".fcgi" => > > (( > > "socket" => "/apps/code/log/code.socket", > > "min-procs" => 2, > > "max-procs" => 2, > > "bin-path" => "/apps/code/public/dispatch.fcgi", > > "bin-environment" => ( "RAILS_ENV" => "production" ) > > ))) > >} > > > >$HTTP["url"] =~ "^/test" { > > server.document-root = "/apps/test/public/" > > alias.url = ( "/test" => "/apps/test/public" ) > > server.error-handler-404 = "/test/dispatch.fcgi" > > server.errorlog = "/apps/test/log/lighttpd.error.log" > > accesslog.filename = "/apps/test/log/lighttpd.access.log" > > server.indexfiles = ( "dispatch.fcgi", "index.html" ) > > > > fastcgi.server = ( ".fcgi" => > > (( > > "socket" => "/apps/test/log/test.socket", > > "min-procs" => 2, > > "max-procs" => 2, > > "bin-path" => "/apps/test/public/dispatch.fcgi", > > "bin-environment" => ( "RAILS_ENV" => "production" ) > > ))) > >} > > > > > > > > > >mimetype.assign = ( > > ".css" => "text/css", > > ".gif" => "image/gif", > > ".htm" => "text/html", > > ".html" => "text/html", > > ".jpeg" => "image/jpeg", > > ".jpg" => "image/jpeg", > > ".js" => "text/javascript", > > ".png" => "image/png", > > ".swf" => "application/x-shockwave-flash", > > ".txt" => "text/plain" > >) > >-------------- > > > >Doing this with SCGI is just as easy. Just change the appropriate sections and it should work fine. > > > >Good luck!!! > > > >-Brian > > > -- > > -- Stephen Bannasch > Director of Technology, Concord Consortium > 10 Concord Crossing, Suite 300, Concord, MA 01742 > direct and fax: 978 405-3209 main: 978 405 3200 > http://www.concord.org mailto:stephen@concord.org > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >
Stephen Bannasch wrote:> So for anybody else who is interested example here''s the conditional > config block for one of my test apps which is accessed via url: > host.com/railsapp1 > > $HTTP["url"] =~ "^/railsapp1" { > server.document-root = "/Users/stephen/dev/rails/railsapp1/public/" > alias.url = ( "/railsapp1" => > "/Users/stephen/dev/rails/railsapp1/public" ) > accesslog.filename > "/Users/stephen/dev/rails/railsapp1/log/access.log" > server.error-handler-404 = "dispatch.fcgi" > server.errorlog > "/Users/stephen/dev/rails/railsapp1/log/lighttpd.error.log" > server.indexfiles = ( "dispatch.fcgi", "index.html" ) > # rails stuff > fastcgi.server = ( ".fcgi" => > ( > ( > "socket" => "/Users/stephen/dev/rails/railsapp1/log/code.socket", > "min-procs" => 2, > "max-procs" => 2, > "bin-path" => > "/Users/stephen/dev/rails/railsapp1/public/dispatch.fcgi", > "bin-environment" => ( "RAILS_ENV" => "development" ) > ))) > } >I can''t get this config to work, strange... I have an Apache running at the public address with below in the config: ProxyPass /cookbook http://localhost:3000/cookbook ProxyPassReverse /cookbook http://localhost:3000/cookbook Then I use the following lighttpd config: # Default configuration file for the lighttpd web server # Start using ./script/server lighttpd server.port = 3000 server.modules = ( "mod_rewrite", "mod_accesslog", "mod_fastcgi" , "mod_alias" ) # server.error-handler-404 = "/dispatch.fcgi" server.document-root = "/home/bbraem/cookbook/public" server.event-handler = "freebsd-kqueue" # server.indexfiles = ( "dispatch.fcgi", "index.html" ) # server.errorlog = "log/lighttpd.error.log" # accesslog.filename = "log/lighttpd.access.log" # url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "$1.html" ) # Change *-procs to 2 if you need to use Upload Progress or other tasks that # *need* to execute a second request while the first is still pending. # fastcgi.server = ( ".fcgi" => # ( "localhost" => # ( # "min-procs" => 1, # "max-procs" => 1, # "socket" => "log/fcgi.socket", # "bin-path" => "/home/bbraem/cookbook/public/dispatch.fcgi", # "bin-environment" => ( "RAILS_ENV" => "development" ) # ) # ) # ) $HTTP["url"] =~ "^/cookbook" { server.document-root = "/home/bbraem/cookbook/public/" alias.url = ( "/cookbook" => "/home/bbraem/cookbook/public" ) accesslog.filename = "/home/bbraem/cookbook/log/access.log" server.error-handler-404 = "dispatch.fcgi" server.errorlog = "/home/bbraem/cookbook/log/lighttpd.error.log" server.indexfiles = ( "dispatch.fcgi", "index.html" ) # rails stuff fastcgi.server = ( ".fcgi" => ( ( "socket" => "/home/bbraem/cookbook/log/code.socket", "min-procs" => 2, "max-procs" => 2, "bin-path" => "/home/bbraem/cookbook/public/dispatch.fcgi", "bin-environment" => ( "RAILS_ENV" => "development" ) ))) } mimetype.assign = ( ".css" => "text/css", ".gif" => "image/gif", ".htm" => "text/html", ".html" => "text/html", ".jpeg" => "image/jpeg", ".jpg" => "image/jpeg", ".js" => "text/javascript", ".png" => "image/png", ".swf" => "application/x-shockwave-flash", ".txt" => "text/plain" ) When starting this config I get no problems, but surfing to host.com/cookbook or host.com/cookbook/ gives routing errors for "" and "/". Does this work with your index.html?
Stephen Bannasch
2006-Mar-16 18:31 UTC
[Rails] RE: hosting multiple rails apps in one webroot?
Bart,>When starting this config I get no problems, but surfing to >host.com/cookbook or host.com/cookbook/ gives routing errors for "" and >"/". Does this work with your index.html?Does the file cookbook/public/index.html exist? Does host.com/cookbook/index.html work? If this works and host.com/cookbook doesn''t change the order of index.html and dispatch.fcgi in your config block: server.indexfiles = ( "index.html", "dispatch.fcgi" ) Lighttpd will now first look for the presence of index.html when serving a directory and only when not found look for dispatch.fcgi in the same dir. Or leave it the way it is and add the following line to the END of cookbook/config/routes.rb: map.connect '''', :controller => ''recipe'', :action => ''list'' Set the :controller and :action to point to what you would like your app to display on entry at the top. You need to decide whether you want lighttpd to serve up any index.html files for your rails app at all. You can instead handle this kind of url request by specifying a default route. FYI: When I was trying to fix my earlier problems I was having I turned on the debugging flags for lighttpd in lighttpd.conf. The debugging data appear in lighttpd.error.log. ## enable debugging debug.log-request-header = "enable" debug.log-response-header = "enable" debug.log-request-handling = "enable" debug.log-file-not-found = "enable" -- -- Stephen Bannasch Director of Technology, Concord Consortium 10 Concord Crossing, Suite 300, Concord, MA 01742 direct and fax: 978 405-3209 main: 978 405 3200 http://www.concord.org mailto:stephen@concord.org
Stephen,> Does the file cookbook/public/index.html exist? > Does host.com/cookbook/index.html work?The file exists and the url works.> If this works and > host.com/cookbook doesn''t change the order of index.html and dispatch.fcgi > in your config block: > > server.indexfiles = ( "index.html", "dispatch.fcgi" ) > > Lighttpd will now first look for the presence of index.html when serving a > directory and only when not found look for dispatch.fcgi in the same dir. >I tried that but it does not seem to help, strange. I guess there is something wrong with my rewrite rules, here''s what I get when debugging is turned on (thanks for that hint!). The urls are: host.com/cookbook, host.com/cookbook/, host.com/cookbook/index.html. 2006-03-17 09:38:27: (response.c.196) -- splitting Request-URI 2006-03-17 09:38:27: (response.c.197) Request-URI : /cookbook 2006-03-17 09:38:27: (response.c.198) URI-scheme : http 2006-03-17 09:38:27: (response.c.199) URI-authority: localhost:3000 2006-03-17 09:38:27: (response.c.200) URI-path : /cookbook 2006-03-17 09:38:27: (response.c.201) URI-query : 2006-03-17 09:38:27: (response.c.196) -- splitting Request-URI 2006-03-17 09:38:27: (response.c.197) Request-URI : //cookbook.html 2006-03-17 09:38:27: (response.c.198) URI-scheme : http 2006-03-17 09:38:27: (response.c.199) URI-authority: localhost:3000 2006-03-17 09:38:27: (response.c.200) URI-path : //cookbook.html 2006-03-17 09:38:27: (response.c.201) URI-query : 2006-03-17 09:38:27: (response.c.251) -- sanatising URI 2006-03-17 09:38:27: (response.c.252) URI-path : /cookbook.html 2006-03-17 09:38:27: (response.c.360) -- before doc_root 2006-03-17 09:38:27: (response.c.361) Doc-Root : /home/bbraem/cookbook/public/ 2006-03-17 09:38:27: (response.c.362) Rel-Path : /cookbook.html 2006-03-17 09:38:27: (response.c.363) Path : 2006-03-17 09:38:27: (response.c.411) -- after doc_root 2006-03-17 09:38:27: (response.c.412) Doc-Root : /home/bbraem/cookbook/public/ 2006-03-17 09:38:27: (response.c.413) Rel-Path : /cookbook.html 2006-03-17 09:38:27: (response.c.414) Path : /home/bbraem/cookbook/public/cookbook.html 2006-03-17 09:38:27: (response.c.431) -- logical -> physical 2006-03-17 09:38:27: (response.c.432) Doc-Root : /home/bbraem/cookbook/public/ 2006-03-17 09:38:27: (response.c.433) Rel-Path : /cookbook.html 2006-03-17 09:38:27: (response.c.434) Path : /home/bbraem/cookbook/public.html 2006-03-17 09:38:27: (response.c.451) -- handling physical path 2006-03-17 09:38:27: (response.c.452) Path : /home/bbraem/cookbook/public.html 2006-03-17 09:38:27: (response.c.492) -- file not found 2006-03-17 09:38:27: (response.c.493) Path : /home/bbraem/cookbook/public.html 2006-03-17 09:38:27: (response.c.196) -- splitting Request-URI 2006-03-17 09:38:27: (response.c.197) Request-URI : dispatch.fcgi 2006-03-17 09:38:27: (response.c.198) URI-scheme : http 2006-03-17 09:38:27: (response.c.199) URI-authority: localhost:3000 2006-03-17 09:38:27: (response.c.200) URI-path : dispatch.fcgi 2006-03-17 09:38:27: (response.c.201) URI-query : 2006-03-17 09:38:27: (response.c.251) -- sanatising URI 2006-03-17 09:38:27: (response.c.252) URI-path : /dispatch.fcgi 2006-03-17 09:38:27: (response.c.360) -- before doc_root 2006-03-17 09:38:27: (response.c.361) Doc-Root : /home/bbraem/cookbook/public/ 2006-03-17 09:38:27: (response.c.362) Rel-Path : /dispatch.fcgi 2006-03-17 09:38:27: (response.c.363) Path : 2006-03-17 09:38:27: (response.c.411) -- after doc_root 2006-03-17 09:38:27: (response.c.412) Doc-Root : /home/bbraem/cookbook/public/ 2006-03-17 09:38:27: (response.c.413) Rel-Path : /dispatch.fcgi 2006-03-17 09:38:27: (response.c.414) Path : /home/bbraem/cookbook/public/dispatch.fcgi 2006-03-17 09:38:27: (response.c.431) -- logical -> physical 2006-03-17 09:38:27: (response.c.432) Doc-Root : /home/bbraem/cookbook/public/ 2006-03-17 09:38:27: (response.c.433) Rel-Path : /dispatch.fcgi 2006-03-17 09:38:27: (response.c.434) Path : /home/bbraem/cookbook/public/dispatch.fcgi 2006-03-17 09:38:27: (response.c.451) -- handling physical path 2006-03-17 09:38:27: (response.c.452) Path : /home/bbraem/cookbook/public/dispatch.fcgi 2006-03-17 09:38:27: (response.c.459) -- file found 2006-03-17 09:38:27: (response.c.460) Path : /home/bbraem/cookbook/public/dispatch.fcgi 2006-03-17 09:38:27: (response.c.582) -- handling subrequest 2006-03-17 09:38:27: (response.c.583) Path : /home/bbraem/cookbook/public/dispatch.fcgi 2006-03-17 09:38:27: (mod_fastcgi.c.3549) handling it in mod_fastcgi 2006-03-17 09:38:27: (connections.c.1394) Warning: Either the error-handler returned status 404 or the error-handler itself was not found: dispatch.fcgi 2006-03-17 09:38:27: (connections.c.1396) returning the original status 404 2006-03-17 09:38:27: (connections.c.1398) If this is a rails app: check your production.log 2006-03-17 09:38:27: (response.c.111) Response-Header: HTTP/1.1 404 Not Found 2006-03-17 09:38:29: (response.c.196) -- splitting Request-URI 2006-03-17 09:38:29: (response.c.197) Request-URI : /cookbook/ 2006-03-17 09:38:29: (response.c.198) URI-scheme : http 2006-03-17 09:38:29: (response.c.199) URI-authority: localhost:3000 2006-03-17 09:38:29: (response.c.200) URI-path : /cookbook/ 2006-03-17 09:38:29: (response.c.201) URI-query : 2006-03-17 09:38:29: (response.c.196) -- splitting Request-URI 2006-03-17 09:38:29: (response.c.197) Request-URI : //cookbook/.html 2006-03-17 09:38:29: (response.c.198) URI-scheme : http 2006-03-17 09:38:29: (response.c.199) URI-authority: localhost:3000 2006-03-17 09:38:29: (response.c.200) URI-path : //cookbook/.html 2006-03-17 09:38:29: (response.c.201) URI-query : 2006-03-17 09:38:29: (response.c.251) -- sanatising URI 2006-03-17 09:38:29: (response.c.252) URI-path : /cookbook/.html 2006-03-17 09:38:29: (response.c.360) -- before doc_root 2006-03-17 09:38:29: (response.c.361) Doc-Root : /home/bbraem/cookbook/public/ 2006-03-17 09:38:29: (response.c.362) Rel-Path : /cookbook/.html 2006-03-17 09:38:29: (response.c.363) Path : 2006-03-17 09:38:29: (response.c.411) -- after doc_root 2006-03-17 09:38:29: (response.c.412) Doc-Root : /home/bbraem/cookbook/public/ 2006-03-17 09:38:29: (response.c.413) Rel-Path : /cookbook/.html 2006-03-17 09:38:29: (response.c.414) Path : /home/bbraem/cookbook/public/cookbook/.html 2006-03-17 09:38:29: (response.c.431) -- logical -> physical 2006-03-17 09:38:29: (response.c.432) Doc-Root : /home/bbraem/cookbook/public/ 2006-03-17 09:38:29: (response.c.433) Rel-Path : /cookbook/.html 2006-03-17 09:38:29: (response.c.434) Path : /home/bbraem/cookbook/public/.html 2006-03-17 09:38:29: (response.c.451) -- handling physical path 2006-03-17 09:38:29: (response.c.452) Path : /home/bbraem/cookbook/public/.html 2006-03-17 09:38:29: (response.c.492) -- file not found 2006-03-17 09:38:29: (response.c.493) Path : /home/bbraem/cookbook/public/.html 2006-03-17 09:38:29: (response.c.196) -- splitting Request-URI 2006-03-17 09:38:29: (response.c.197) Request-URI : dispatch.fcgi 2006-03-17 09:38:29: (response.c.198) URI-scheme : http 2006-03-17 09:38:29: (response.c.199) URI-authority: localhost:3000 2006-03-17 09:38:29: (response.c.200) URI-path : dispatch.fcgi 2006-03-17 09:38:29: (response.c.201) URI-query : 2006-03-17 09:38:29: (response.c.251) -- sanatising URI 2006-03-17 09:38:29: (response.c.252) URI-path : /dispatch.fcgi 2006-03-17 09:38:29: (response.c.360) -- before doc_root 2006-03-17 09:38:29: (response.c.361) Doc-Root : /home/bbraem/cookbook/public/ 2006-03-17 09:38:29: (response.c.362) Rel-Path : /dispatch.fcgi 2006-03-17 09:38:29: (response.c.363) Path : 2006-03-17 09:38:29: (response.c.411) -- after doc_root 2006-03-17 09:38:29: (response.c.412) Doc-Root : /home/bbraem/cookbook/public/ 2006-03-17 09:38:29: (response.c.413) Rel-Path : /dispatch.fcgi 2006-03-17 09:38:29: (response.c.414) Path : /home/bbraem/cookbook/public/dispatch.fcgi 2006-03-17 09:38:29: (response.c.431) -- logical -> physical 2006-03-17 09:38:29: (response.c.432) Doc-Root : /home/bbraem/cookbook/public/ 2006-03-17 09:38:29: (response.c.433) Rel-Path : /dispatch.fcgi 2006-03-17 09:38:29: (response.c.434) Path : /home/bbraem/cookbook/public/dispatch.fcgi 2006-03-17 09:38:29: (response.c.451) -- handling physical path 2006-03-17 09:38:29: (response.c.452) Path : /home/bbraem/cookbook/public/dispatch.fcgi 2006-03-17 09:38:29: (response.c.459) -- file found 2006-03-17 09:38:29: (response.c.460) Path : /home/bbraem/cookbook/public/dispatch.fcgi 2006-03-17 09:38:29: (response.c.582) -- handling subrequest 2006-03-17 09:38:29: (response.c.583) Path : /home/bbraem/cookbook/public/dispatch.fcgi 2006-03-17 09:38:29: (mod_fastcgi.c.3549) handling it in mod_fastcgi 2006-03-17 09:38:29: (connections.c.1394) Warning: Either the error-handler returned status 404 or the error-handler itself was not found: dispatch.fcgi 2006-03-17 09:38:29: (connections.c.1396) returning the original status 404 2006-03-17 09:38:29: (connections.c.1398) If this is a rails app: check your production.log 2006-03-17 09:38:29: (response.c.111) Response-Header: HTTP/1.1 404 Not Found 2006-03-17 09:38:33: (response.c.196) -- splitting Request-URI 2006-03-17 09:38:33: (response.c.197) Request-URI : /cookbook/index.html 2006-03-17 09:38:33: (response.c.198) URI-scheme : http 2006-03-17 09:38:33: (response.c.199) URI-authority: localhost:3000 2006-03-17 09:38:33: (response.c.200) URI-path : /cookbook/index.html 2006-03-17 09:38:33: (response.c.201) URI-query : 2006-03-17 09:38:33: (response.c.251) -- sanatising URI 2006-03-17 09:38:33: (response.c.252) URI-path : /cookbook/index.html 2006-03-17 09:38:33: (response.c.360) -- before doc_root 2006-03-17 09:38:33: (response.c.361) Doc-Root : /home/bbraem/cookbook/public/ 2006-03-17 09:38:33: (response.c.362) Rel-Path : /cookbook/index.html 2006-03-17 09:38:33: (response.c.363) Path : 2006-03-17 09:38:33: (response.c.411) -- after doc_root 2006-03-17 09:38:33: (response.c.412) Doc-Root : /home/bbraem/cookbook/public/ 2006-03-17 09:38:33: (response.c.413) Rel-Path : /cookbook/index.html 2006-03-17 09:38:33: (response.c.414) Path : /home/bbraem/cookbook/public/cookbook/index.html 2006-03-17 09:38:33: (response.c.431) -- logical -> physical 2006-03-17 09:38:33: (response.c.432) Doc-Root : /home/bbraem/cookbook/public/ 2006-03-17 09:38:33: (response.c.433) Rel-Path : /cookbook/index.html 2006-03-17 09:38:33: (response.c.434) Path : /home/bbraem/cookbook/public/index.html 2006-03-17 09:38:33: (response.c.451) -- handling physical path 2006-03-17 09:38:33: (response.c.452) Path : /home/bbraem/cookbook/public/index.html 2006-03-17 09:38:33: (response.c.459) -- file found 2006-03-17 09:38:33: (response.c.460) Path : /home/bbraem/cookbook/public/index.html 2006-03-17 09:38:33: (response.c.582) -- handling subrequest 2006-03-17 09:38:33: (response.c.583) Path : /home/bbraem/cookbook/public/index.html 2006-03-17 09:38:33: (mod_staticfile.c.386) -- handling file as static file 2006-03-17 09:38:33: (response.c.594) -- subrequest finished 2006-03-17 09:38:33: (response.c.111) Response-Header: HTTP/1.1 304 Not Modified> You need to decide whether you want lighttpd to serve up any index.html > files for your rails app at all. You can instead handle this kind of url > request by specifying a default route. >I''m also experiencing problems with images so I''d like this fixed with index.html, of course my frontpage should become dynamic if I want my application to be a little bit interesting... Thanks for your response! Bart
Glad it worked... That''s crazy. Not sure why my example didn''t work for you... It''s pulled right off of my working linux server... But I am using lighttpd 1.4.7 on Debian so maybe something changed in the more current version. I like your version better anyway; to me it makes more sense. -bph -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Stephen Bannasch Sent: Wednesday, March 15, 2006 11:31 PM To: rails@lists.rubyonrails.org Subject: RE: [Rails] hosting multiple rails apps in one webroot? Brian, Your config listed below ALMOST worked ... In the $HTTP["url"] conditional config blocks I had to change: server.error-handler-404 = "/code/dispatch.fcgi" to server.error-handler-404 = "dispatch.fcgi" I''m using lighttpd 1.4.11 on MacOS X 10.4.5. I hadn''t realized how convoluted the process lighttpd uses is in order to get to my rails apps. I enabled lighttpd debugging and carefully watched the error log. When I connect to the url: host.com/railsapp1/controller/method lighttpd first discovers that the file: /Users/stephen/dev/rails/railsapp1/public/controller/method doesn''t exist before connecting to: /Users/stephen/dev/rails/railsapp1/public/dispatch.fcgi and passing in the route: /railsapp1/controller/method Which works because the following param in config/environment.rb (thanks for pointing it out): ActionController::AbstractRequest.relative_url_root = "/railsapp1" gets rails to strip the leading appname before routing. So for anybody else who is interested example here''s the conditional config block for one of my test apps which is accessed via url: host.com/railsapp1 $HTTP["url"] =~ "^/railsapp1" { server.document-root = "/Users/stephen/dev/rails/railsapp1/public/" alias.url = ( "/railsapp1" => "/Users/stephen/dev/rails/railsapp1/public" ) accesslog.filename "/Users/stephen/dev/rails/railsapp1/log/access.log" server.error-handler-404 = "dispatch.fcgi" server.errorlog "/Users/stephen/dev/rails/railsapp1/log/lighttpd.error.log" server.indexfiles = ( "dispatch.fcgi", "index.html" ) # rails stuff fastcgi.server = ( ".fcgi" => ( ( "socket" => "/Users/stephen/dev/rails/railsapp1/log/code.socket", "min-procs" => 2, "max-procs" => 2, "bin-path" => "/Users/stephen/dev/rails/railsapp1/public/dispatch.fcgi", "bin-environment" => ( "RAILS_ENV" => "development" ) ))) } Thanks for your suggestion. At 2:16 PM -0600 3/7/06, Hogan, Brian P. wrote:>It''s actually REALLY easy with lighttpd on linux. > >Two apps... > >Myserver.com/code/ => /apps/code/ >Myserver.com/test/ +> /apps/test/ > > > >Each application needs this in the environment.rb > >/apps/code/config/environment.rb > >ActionController::AbstractRequest.relative_url_root = "/code" > >/apps/test/config/environment.rb > >ActionController::AbstractRequest.relative_url_root = "/test" > > > >Here''s a lighttpd config file that runs on port 80. Be sure to activate>mod_alias!! > > ># Default configuration file for the lighttpd web server ># Start using ./script/server lighttpd > >server.port = 80 >server.modules = ("mod_alias", "mod_rewrite","mod_accesslog", "mod_fastcgi" )>server.document-root = "/apps/root/" >url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" =>"$1.html" )> >$HTTP["url"] =~ "^/code" { > server.document-root = "/apps/code/public/" > alias.url = ( "/code" => "/apps/code/public" ) > server.error-handler-404 = "/code/dispatch.fcgi" > server.errorlog = "/apps/code/log/lighttpd.error.log" > accesslog.filename = "/apps/code/log/lighttpd.access.log" > server.indexfiles = ( "dispatch.fcgi", "index.html" ) > > fastcgi.server = ( ".fcgi" => > (( > "socket" => "/apps/code/log/code.socket", > "min-procs" => 2, > "max-procs" => 2, > "bin-path" => "/apps/code/public/dispatch.fcgi", > "bin-environment" => ( "RAILS_ENV" => "production" ) > ))) >} > >$HTTP["url"] =~ "^/test" { > server.document-root = "/apps/test/public/" > alias.url = ( "/test" => "/apps/test/public" ) > server.error-handler-404 = "/test/dispatch.fcgi" > server.errorlog = "/apps/test/log/lighttpd.error.log" > accesslog.filename = "/apps/test/log/lighttpd.access.log" > server.indexfiles = ( "dispatch.fcgi", "index.html" ) > > fastcgi.server = ( ".fcgi" => > (( > "socket" => "/apps/test/log/test.socket", > "min-procs" => 2, > "max-procs" => 2, > "bin-path" => "/apps/test/public/dispatch.fcgi", > "bin-environment" => ( "RAILS_ENV" => "production" ) > ))) >} > > > > >mimetype.assign = ( > ".css" => "text/css", > ".gif" => "image/gif", > ".htm" => "text/html", > ".html" => "text/html", > ".jpeg" => "image/jpeg", > ".jpg" => "image/jpeg", > ".js" => "text/javascript", > ".png" => "image/png", > ".swf" => "application/x-shockwave-flash", > ".txt" => "text/plain" >) >-------------- > >Doing this with SCGI is just as easy. Just change the appropriate >sections and it should work fine. > >Good luck!!! > >-Brian-- -- Stephen Bannasch Director of Technology, Concord Consortium 10 Concord Crossing, Suite 300, Concord, MA 01742 direct and fax: 978 405-3209 main: 978 405 3200 http://www.concord.org mailto:stephen@concord.org _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails
Stephen Bannasch
2006-Mar-21 04:21 UTC
[Rails] RE: hosting multiple rails apps in one webroot?
At 9:49 AM +0100 3/17/06, Bart Braem wrote:>I tried that but it does not seem to help, strange. I guess there is >something wrong with my rewrite rules, here''s what I get when debugging is >turned on (thanks for that hint!). The urls are: host.com/cookbook, >host.com/cookbook/, host.com/cookbook/index.html. > >2006-03-17 09:38:27: (response.c.196) -- splitting Request-URI >2006-03-17 09:38:27: (response.c.197) Request-URI : /cookbook >2006-03-17 09:38:27: (response.c.198) URI-scheme : http >2006-03-17 09:38:27: (response.c.199) URI-authority: localhost:3000 >2006-03-17 09:38:27: (response.c.200) URI-path : /cookbook >2006-03-17 09:38:27: (response.c.201) URI-query : >2006-03-17 09:38:27: (response.c.196) -- splitting Request-URI >2006-03-17 09:38:27: (response.c.197) Request-URI : //cookbook.html >2006-03-17 09:38:27: (response.c.198) URI-scheme : http >2006-03-17 09:38:27: (response.c.199) URI-authority: localhost:3000 >2006-03-17 09:38:27: (response.c.200) URI-path : //cookbook.htmlIt looks like some rewrite rule is changing cookbook to cookbook.html. I''d suggest getting rid of any rewrite rules. The only thing like a rewrite rule I have in my lighttpd.conf file is: index-file.names = ( "index.php", "index.html", "index.htm", "default.htm", "dispatch.fcgi")>2006-03-17 09:38:29: (response.c.196) -- splitting Request-URI >2006-03-17 09:38:29: (response.c.197) Request-URI : /cookbook/ >2006-03-17 09:38:29: (response.c.198) URI-scheme : http >2006-03-17 09:38:29: (response.c.199) URI-authority: localhost:3000 >2006-03-17 09:38:29: (response.c.200) URI-path : /cookbook/ >2006-03-17 09:38:29: (response.c.201) URI-query : >2006-03-17 09:38:29: (response.c.196) -- splitting Request-URI >2006-03-17 09:38:29: (response.c.197) Request-URI : //cookbook/.htmlAgain the ".html" is being added. You can download the source for your version of lighttpd and check what line 197 in response.c is doing OR you can just comment out all your rewrite rules to see if that helps. Now this one worked. I''ll bet the rewrite rule saw the ".html" and didn''t activate.>2006-03-17 09:38:33: (response.c.196) -- splitting Request-URI >2006-03-17 09:38:33: (response.c.197) Request-URI : /cookbook/index.html >2006-03-17 09:38:33: (response.c.198) URI-scheme : http >2006-03-17 09:38:33: (response.c.199) URI-authority: localhost:3000 >2006-03-17 09:38:33: (response.c.200) URI-path : /cookbook/index.html >2006-03-17 09:38:33: (response.c.201) URI-query : >2006-03-17 09:38:33: (response.c.251) -- sanatising URI >2006-03-17 09:38:33: (response.c.252) URI-path : /cookbook/index.html >2006-03-17 09:38:33: (response.c.360) -- before doc_root-- - Stephen Bannasch Concord Consortium, http://www.concord.org
Stephen Bannasch wrote:> It looks like some rewrite rule is changing cookbook to cookbook.html. I''d > suggest getting rid of any rewrite rules. The only thing like a rewrite > rule I have in my lighttpd.conf file is: > > index-file.names = ( "index.php", "index.html", > "index.htm", "default.htm", > "dispatch.fcgi")That did it! Thank you very much! I''ll add this information to the wiki as soon as possible. This will help other people for sure. All I have to do is find a nice page to link this in. Thanks again Bart
That did it for me too! Just one small problem... My css path is jacked up now. since my url is: http://dev/ro/railsapp1/ it won''t recognize for some reason where that css really is. I hacked it and put it (stylesheets/) under the ''normal'' server''s webroot (it works but not recommended) but I''m sure there''s a way for it to recognize it under it''s own virtual path...i.e. /home/ro/public_html/railsapp1/public/stylesheets/scaffold.css this is my vhost conf: 1 $HTTP["url"] =~ "^/ro\/railsapp1" { 2 server.document-root = "/home/ro/public_html/railsapp1/public/" 3 alias.url = ( "/ro\/railsapp1" => "/home/ro/public_html/railsapp1/public" ) 4 accesslog.filename = "/home/ro/public_html/railsapp1/log/access.log" 5 server.error-handler-404 = "dispatch.fcgi" 6 server.errorlog = "/home/ro/public_html/railsapp1/log/lighttpd.error.log" 7 server.indexfiles = ( "dispatch.fcgi", "index.html" ) 8 # rails stuff 9 fastcgi.server = ( 10 ".fcgi" => ( 11 ( "socket" => "/home/ro/public_html/railsapp1/log/code.socket", 12 "min-procs" => 2, 13 "max-procs" => 2, 14 "bin-path" => "/home/ro/public_html/railsapp1/public/dispatch.fcgi", 15 "bin-environment" => ( "RAILS_ENV" => "development" ) 16 )) 17 ) 18 } thanks, ro Bart Braem wrote:> Stephen Bannasch wrote: > >> It looks like some rewrite rule is changing cookbook to cookbook.html. I''d >> suggest getting rid of any rewrite rules. The only thing like a rewrite >> rule I have in my lighttpd.conf file is: >> >> index-file.names = ( "index.php", "index.html", >> "index.htm", "default.htm", >> "dispatch.fcgi") > > That did it! Thank you very much! I''ll add this information to the wiki > as > soon as possible. This will help other people for sure. All I have to do > is > find a nice page to link this in. > > Thanks again > Bart-- Posted via http://www.ruby-forum.com/.
Bart Braem wrote:> That did it! Thank you very much! I''ll add this information to the wiki as > soon as possible. This will help other people for sure. All I have to do > is find a nice page to link this in.I have added this information to <http://wiki.rubyonrails.com/rails/pages/HowtoSetupApacheProxyingToLighttpdWithFastCGI>, linked from <http://wiki.rubyonrails.org/rails/pages/HowtosInstallation>. Any comments or additions are welcome of course! Bart
Stephen Bannasch
2006-Mar-22 17:31 UTC
[Rails] RE: hosting multiple rails apps in one webroot?
>Any comments or additions are welcome of course! >BartThe lighttpd.conf section looks good. The lighttpd.conf $HTTP[$url] configuration block technique can also be used with or without Apache proxing and is very handy when you want to host multiple raiils apps without making new subdomains. re: server.event-handler = "freebsd-kqueue" # this is for FreeBSD! I usually put the comment just before the directive. -- - Stephen Bannasch Concord Consortium, http://www.concord.org
Stephen Bannasch
2006-Mar-22 18:48 UTC
[Rails] hosting multiple rails apps in one webroot?
>That did it for me too! Just one small problem... > >My css path is jacked up now. since my url is: > >http://dev/ro/railsapp1/ > >it won''t recognize for some reason where that css really is. > >I hacked it and put it (stylesheets/) under the ''normal'' server''s >webroot (it works but not recommended) but I''m sure there''s a way for it >to recognize it under it''s own virtual path...i.e. >/home/ro/public_html/railsapp1/public/stylesheets/scaffold.cssDid you try setting this in config/environment.rb: ActionController::AbstractRequest.relative_url_root = ''/railsapp1'' add it at the bottom: -- - Stephen Bannasch Concord Consortium, http://www.concord.org
If you notice on this line: $HTTP["url"] =~ "^/ro\/railsapp1" I have it under a main directory called /ro/ in lighty pointing to the filesystem (/home/ro/public_html/railsapp1/public) So I would, ideally, have: http://dev/ro/railsapp1 http://dev/ro/railsapp2 What ''fixed'' my problem is that I combined the name so that I ONLY have one main directory per app: Like so: $HTTP["url"] =~ "^/rorailsapp1" ... $HTTP["url"] =~ "^/joerailsapp1" ... http://dev/rorailsapp1 --> (/home/ro/public_html/railsapp1/public) http://dev/joerailsapp1 --> (/home/joe/public_html/railsapp1/public) So that I can have a nice CVS or Subversion type environment. Maybe I''m not approaching this the right way. It works but It''d rather have it to where the vhost is identified by user http://dev/ro/<all rails apps here>... Does this make sense Stephen? thanks, -ro- Stephen Bannasch wrote:>>to recognize it under it''s own virtual path...i.e. >>/home/ro/public_html/railsapp1/public/stylesheets/scaffold.css > > Did you try setting this in config/environment.rb: > > ActionController::AbstractRequest.relative_url_root = ''/railsapp1'' > > add it at the bottom:-- Posted via http://www.ruby-forum.com/.