Hi, I have got lighttpd set up this evening so that I can host my Ruby on Rails applications. It is running on port 81 with Apache on 80 on a cPanel Fedora 2 server. I want to install at least 2 Rails applications onto the server - my own and the blog, Typo. I have Lighttpd set up to launch fcgi for the document root e.g. http://www.example.com would load my rails app fine. However, I also want to have the blog app at http://www.example.com/blog - which should load a different rails app in fcgi. The applications on my server are in the directories: /home/notes/mainapp/public - my main app for at http://www.example.com /home/notes/blog/public - the blog for at http://www.example.com/blog I have tried to set this up, but I can''t get it to work. I can get my mail rails app to load at http://www.example.com but when I go to http://www.example.com/blog I just get 404 - Not Found In the lighttpd.conf file, I have this (along with a few other lines that are needed: server.document-root = "/home/notes/testapp/public" fastcgi.server = (".fcgi" => ( "railsapp" => ( "min-procs" => 1, "max-procs" => 5, "socket" => "/tmp/ruby-railsapp.fastcgi", "bin-path" => "/home/notes/testapp/public/dispatch.fcgi" ) )) $HTTP["url"] =~ "^/testapp" { url.rewrite = ( "^/testapp(/.*)$" => "/testapp$1" ) fastcgi.server = ( "dispatch.fcgi" => (( "/home/notes/testapp/public/dispatch.fcgi", "socket" => "/tmp/ruby-railsapp.fastcgi", "bin-path" => "/home/notes/testapp/public/dispatch.fcgi", "max-procs" => 5 )) ) server.error-handler-404 = "/home/notes/testapp/public/dispatch.fcgi" } Has anyone got this set up on their own server? And if so, would you mind sharing how? :) -- Regards, David Mytton http://www.olate.co.uk
I would imagine it''s your .htaccess in your rails application that is eating up the request for www.example.com/blog . You can write a rewrite condition within that .htaccess file NOT to push the request to the dispatcher. Jake David Mytton wrote:> Hi, > > I have got lighttpd set up this evening so that I can host my Ruby on > Rails applications. It is running on port 81 with Apache on 80 on a > cPanel Fedora 2 server. > > I want to install at least 2 Rails applications onto the server - my > own and the blog, Typo. I have Lighttpd set up to launch fcgi for the > document root e.g. http://www.example.com would load my rails app > fine. However, I also want to have the blog app at > http://www.example.com/blog - which should load a different rails app > in fcgi. > > The applications on my server are in the directories: > > /home/notes/mainapp/public - my main app for at http://www.example.com > /home/notes/blog/public - the blog for at http://www.example.com/blog > > I have tried to set this up, but I can''t get it to work. I can get my > mail rails app to load at http://www.example.com but when I go to > http://www.example.com/blog I just get 404 - Not Found > > In the lighttpd.conf file, I have this (along with a few other lines > that are needed: > > server.document-root = "/home/notes/testapp/public" > > fastcgi.server = (".fcgi" => ( "railsapp" => > ( "min-procs" => 1, > "max-procs" => 5, > "socket" => "/tmp/ruby-railsapp.fastcgi", > "bin-path" => "/home/notes/testapp/public/dispatch.fcgi" > ) > )) > > $HTTP["url"] =~ "^/testapp" { > url.rewrite = ( "^/testapp(/.*)$" => "/testapp$1" ) > fastcgi.server = ( "dispatch.fcgi" => (( > > "/home/notes/testapp/public/dispatch.fcgi", > "socket" => > "/tmp/ruby-railsapp.fastcgi", > "bin-path" => > "/home/notes/testapp/public/dispatch.fcgi", > "max-procs" => 5 > )) > ) > server.error-handler-404 = "/home/notes/testapp/public/dispatch.fcgi" > } > > Has anyone got this set up on their own server? And if so, would you > mind sharing how? :)
This same question has been asked here: http://forum.textdrive.com/viewtopic.php?id=3125 With no results. For Apache, it''s the RewriteBase directive in .htaccess that makes this possible, and I''ve yet to find how to do the same with Lighttpd. On 8/15/05, Jake Good <jake-UDG8+2NMCBIv34k0vaUUyg@public.gmane.org> wrote:> > I would imagine it''s your .htaccess in your rails application that is > eating up the request for www.example.com/blog<http://www.example.com/blog>. You can write a rewrite > condition within that .htaccess file NOT to push the request to the > dispatcher. > > Jake > > David Mytton wrote: > > > Hi, > > > > I have got lighttpd set up this evening so that I can host my Ruby on > > Rails applications. It is running on port 81 with Apache on 80 on a > > cPanel Fedora 2 server. > > > > I want to install at least 2 Rails applications onto the server - my > > own and the blog, Typo. I have Lighttpd set up to launch fcgi for the > > document root e.g. http://www.example.com would load my rails app > > fine. However, I also want to have the blog app at > > http://www.example.com/blog - which should load a different rails app > > in fcgi. > > > > The applications on my server are in the directories: > > > > /home/notes/mainapp/public - my main app for at http://www.example.com > > /home/notes/blog/public - the blog for at http://www.example.com/blog > > > > I have tried to set this up, but I can''t get it to work. I can get my > > mail rails app to load at http://www.example.com but when I go to > > http://www.example.com/blog I just get 404 - Not Found > > > > In the lighttpd.conf file, I have this (along with a few other lines > > that are needed: > > > > server.document-root = "/home/notes/testapp/public" > > > > fastcgi.server = (".fcgi" => ( "railsapp" => > > ( "min-procs" => 1, > > "max-procs" => 5, > > "socket" => "/tmp/ruby-railsapp.fastcgi", > > "bin-path" => "/home/notes/testapp/public/dispatch.fcgi" > > ) > > )) > > > > $HTTP["url"] =~ "^/testapp" { > > url.rewrite = ( "^/testapp(/.*)$" => "/testapp$1" ) > > fastcgi.server = ( "dispatch.fcgi" => (( > > > > "/home/notes/testapp/public/dispatch.fcgi", > > "socket" => > > "/tmp/ruby-railsapp.fastcgi", > > "bin-path" => > > "/home/notes/testapp/public/dispatch.fcgi", > > "max-procs" => 5 > > )) > > ) > > server.error-handler-404 = "/home/notes/testapp/public/dispatch.fcgi" > > } > > > > Has anyone got this set up on their own server? And if so, would you > > mind sharing how? :) > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Ahh - so it isn''t a problem with lighttpd! Could you give me an example of the rewrite code I should be using to stop it being directed to the dispatcher? Should this code in my root rails app public/.htaccess? Regards, David Mytton Managing Director - Olate Ltd http://www.olate.co.uk T: (646) 257 3714 (USA) T: (020) 7870 9176 (UK) F: (0870) 705 1068 (UK) E: support-ELxQ3fsViAr10XsdtD+oqA@public.gmane.org Jake Good wrote:> I would imagine it''s your .htaccess in your rails application that is > eating up the request for www.example.com/blog . You can write a rewrite > condition within that .htaccess file NOT to push the request to the > dispatcher. > > Jake > > David Mytton wrote: > >> Hi, >> >> I have got lighttpd set up this evening so that I can host my Ruby on >> Rails applications. It is running on port 81 with Apache on 80 on a >> cPanel Fedora 2 server. >> >> I want to install at least 2 Rails applications onto the server - my >> own and the blog, Typo. I have Lighttpd set up to launch fcgi for the >> document root e.g. http://www.example.com would load my rails app >> fine. However, I also want to have the blog app at >> http://www.example.com/blog - which should load a different rails app >> in fcgi. >> >> The applications on my server are in the directories: >> >> /home/notes/mainapp/public - my main app for at http://www.example.com >> /home/notes/blog/public - the blog for at http://www.example.com/blog >> >> I have tried to set this up, but I can''t get it to work. I can get my >> mail rails app to load at http://www.example.com but when I go to >> http://www.example.com/blog I just get 404 - Not Found >> >> In the lighttpd.conf file, I have this (along with a few other lines >> that are needed: >> >> server.document-root = "/home/notes/testapp/public" >> >> fastcgi.server = (".fcgi" => ( "railsapp" => >> ( "min-procs" => 1, >> "max-procs" => 5, >> "socket" => "/tmp/ruby-railsapp.fastcgi", >> "bin-path" => "/home/notes/testapp/public/dispatch.fcgi" >> ) >> )) >> >> $HTTP["url"] =~ "^/testapp" { >> url.rewrite = ( "^/testapp(/.*)$" => "/testapp$1" ) >> fastcgi.server = ( "dispatch.fcgi" => (( >> >> "/home/notes/testapp/public/dispatch.fcgi", >> "socket" => >> "/tmp/ruby-railsapp.fastcgi", >> "bin-path" => >> "/home/notes/testapp/public/dispatch.fcgi", >> "max-procs" => 5 >> )) >> ) >> server.error-handler-404 = "/home/notes/testapp/public/dispatch.fcgi" >> } >> >> Has anyone got this set up on their own server? And if so, would you >> mind sharing how? :) > > >
Hi, If you want to make your life much simpler you could just use a subdomain, eg. "blog.example.com". Then just have something like: $HTTP["host"] == "blog.example.com" { ... }
Yeh, I might have to do that if I can''t get it working - but I was hoping to be able to use http://www.example.com/blog Regards, David Mytton Managing Director - Olate Ltd http://www.olate.co.uk T: (646) 257 3714 (USA) T: (020) 7870 9176 (UK) F: (0870) 705 1068 (UK) E: support-ELxQ3fsViAr10XsdtD+oqA@public.gmane.org Ben Myles wrote:> Hi, > > If you want to make your life much simpler you could just use a > subdomain, eg. "blog.example.com". > > Then just have something like: > > $HTTP["host"] == "blog.example.com" { > ... > }
In your public/.htaccess of your RAILS application... place this above the RewriteRule section RewriteCond %{REQUEST URI} !^/blog* I think that might work (untested), though whatever is taking care of sending the requests to your virtual hosts should be doing this anyway.. Jake David Mytton wrote:> Yeh, I might have to do that if I can''t get it working - but I was > hoping to be able to use http://www.example.com/blog > > Regards, > > David Mytton > Managing Director - Olate Ltd > http://www.olate.co.uk > > T: (646) 257 3714 (USA) T: (020) 7870 9176 (UK) > F: (0870) 705 1068 (UK) E: support-ELxQ3fsViAr10XsdtD+oqA@public.gmane.org > > > > Ben Myles wrote: > >> Hi, >> >> If you want to make your life much simpler you could just use a >> subdomain, eg. "blog.example.com". >> >> Then just have something like: >> >> $HTTP["host"] == "blog.example.com" { >> ... >> } > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Thanks. I had a go at that but it didn''t seem to work. I have Apache set up as a proxy so it directs any requests for my domain to lighttpd. I only have 1 site to use rails so that works fine. I modified my lighttpd.conf file to handle the requests: $HTTP["url"] =~ "^/blog" { url.rewrite = ( "^/blog(/.*)$" => "/blog$1" ) fastcgi.server = ( ".fcgi" => (( "/home/notes/blog/public/dispatch.fcgi", "socket" => "/tmp/ruby-railsapp.fastcgi", "bin-path" => "/home/notes/testapp/public/dispatch.fcgi", "max-procs" => 5, "docroot" => "/" )) ) } $HTTP["url"] =~ "^/" { fastcgi.server = ( ".fcgi" => (( "/home/notes/testapp/public/dispatch.fcgi", "socket" => "/tmp/ruby-railsapp.fastcgi", "bin-path" => "/home/notes/testapp/public/dispatch.fcgi", "max-procs" => 5, "docroot" => "/" )) ) And in my /home/notes/testapp/public/.htaccess file, I added: RewriteEngine On RewriteCond %{REQUEST URI} !^/blog* [L] RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] Now when I go to http://www.example.com I get Routing Error: Recognition failed for "/" which is correct. But when I go to http://www.example.com/blog I get the 404 still. Regards, David Mytton Managing Director - Olate Ltd http://www.olate.co.uk T: (646) 257 3714 (USA) T: (020) 7870 9176 (UK) F: (0870) 705 1068 (UK) E: support-ELxQ3fsViAr10XsdtD+oqA@public.gmane.org Jake Good wrote:> In your public/.htaccess of your RAILS application... place this above > the RewriteRule section > > RewriteCond %{REQUEST URI} !^/blog* > > I think that might work (untested), though whatever is taking care of > sending the requests to your virtual hosts should be doing this anyway.. > > Jake > > David Mytton wrote: > >> Yeh, I might have to do that if I can''t get it working - but I was >> hoping to be able to use http://www.example.com/blog >> >> Regards, >> >> David Mytton >> Managing Director - Olate Ltd >> http://www.olate.co.uk >> >> T: (646) 257 3714 (USA) T: (020) 7870 9176 (UK) >> F: (0870) 705 1068 (UK) E: support-ELxQ3fsViAr10XsdtD+oqA@public.gmane.org >> >> >> >> Ben Myles wrote: >> >>> Hi, >>> >>> If you want to make your life much simpler you could just use a >>> subdomain, eg. "blog.example.com". >>> >>> Then just have something like: >>> >>> $HTTP["host"] == "blog.example.com" { >>> ... >>> } >> >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >
Hmm, that is annoying. I just tried Jake''s idea and it didn''t seem to work. So I guess I''ll have to use the sub domain method instead. Regards, David Mytton Managing Director - Olate Ltd http://www.olate.co.uk T: (646) 257 3714 (USA) T: (020) 7870 9176 (UK) F: (0870) 705 1068 (UK) E: support-ELxQ3fsViAr10XsdtD+oqA@public.gmane.org Colin Ramsay wrote:> This same question has been asked here: > > http://forum.textdrive.com/viewtopic.php?id=3125 > > With no results. For Apache, it''s the RewriteBase directive in .htaccess > that makes this possible, and I''ve yet to find how to do the same with > Lighttpd. > > On 8/15/05, *Jake Good* <jake-UDG8+2NMCBIv34k0vaUUyg@public.gmane.org > <mailto:jake-UDG8+2NMCBIv34k0vaUUyg@public.gmane.org>> wrote: > > I would imagine it''s your .htaccess in your rails application that is > eating up the request for www.example.com/blog > <http://www.example.com/blog> . You can write a rewrite > condition within that .htaccess file NOT to push the request to the > dispatcher. > > Jake > > David Mytton wrote: > > > Hi, > > > > I have got lighttpd set up this evening so that I can host my Ruby on > > Rails applications. It is running on port 81 with Apache on 80 on a > > cPanel Fedora 2 server. > > > > I want to install at least 2 Rails applications onto the server - my > > own and the blog, Typo. I have Lighttpd set up to launch fcgi for the > > document root e.g . http://www.example.com would load my rails app > > fine. However, I also want to have the blog app at > > http://www.example.com/blog - which should load a different > rails app > > in fcgi. > > > > The applications on my server are in the directories: > > > > /home/notes/mainapp/public - my main app for at > http://www.example.com > > /home/notes/blog/public - the blog for at http://www.example.com/blog > > > > I have tried to set this up, but I can''t get it to work. I can > get my > > mail rails app to load at http://www.example.com but when I go to > > http://www.example.com/blog I just get 404 - Not Found > > > > In the lighttpd.conf file, I have this (along with a few other lines > > that are needed: > > > > server.document-root = "/home/notes/testapp/public" > > > > fastcgi.server = (".fcgi" => ( "railsapp" => > > ( "min-procs" => 1, > > "max-procs" => 5, > > "socket" => "/tmp/ruby-railsapp.fastcgi", > > "bin-path" => "/home/notes/testapp/public/dispatch.fcgi" > > ) > > )) > > > > $HTTP["url"] =~ "^/testapp" { > > url.rewrite = ( "^/testapp(/.*)$" => "/testapp$1" ) > > fastcgi.server = ( "dispatch.fcgi " => (( > > > > "/home/notes/testapp/public/dispatch.fcgi", > > "socket" => > > "/tmp/ruby-railsapp.fastcgi", > > "bin-path" => > > "/home/notes/testapp/public/dispatch.fcgi", > > "max-procs" => 5 > > )) > > ) > > server.error-handler-404 > "/home/notes/testapp/public/dispatch.fcgi" > > } > > > > Has anyone got this set up on their own server? And if so, would you > > mind sharing how? :) > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org <mailto:Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org> > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
I couldn''t get this to work so I used the hostname checking and I''m still trying to get that to work properly. In the meantime, I wanted to check out Typo so I set up Lighttpd to use just the 1 Rails app. I went to http://www.example.com and then it redirected me to http://www.example.com/accounts/signup, but I get a 404 Not Found error. To me it sounds like the rewrite isn''t working correctly. Any idea how to get that setup in Lighttpd? Regards, David Mytton Managing Director - Olate Ltd http://www.olate.co.uk T: (646) 257 3714 (USA) T: (020) 7870 9176 (UK) F: (0870) 705 1068 (UK) E: support-ELxQ3fsViAr10XsdtD+oqA@public.gmane.org Jake Good wrote:> In your public/.htaccess of your RAILS application... place this above > the RewriteRule section > > RewriteCond %{REQUEST URI} !^/blog* > > I think that might work (untested), though whatever is taking care of > sending the requests to your virtual hosts should be doing this anyway.. > > Jake > > David Mytton wrote: > >> Yeh, I might have to do that if I can''t get it working - but I was >> hoping to be able to use http://www.example.com/blog >> >> Regards, >> >> David Mytton >> Managing Director - Olate Ltd >> http://www.olate.co.uk >> >> T: (646) 257 3714 (USA) T: (020) 7870 9176 (UK) >> F: (0870) 705 1068 (UK) E: support-ELxQ3fsViAr10XsdtD+oqA@public.gmane.org >> >> >> >> Ben Myles wrote: >> >>> Hi, >>> >>> If you want to make your life much simpler you could just use a >>> subdomain, eg. "blog.example.com". >>> >>> Then just have something like: >>> >>> $HTTP["host"] == "blog.example.com" { >>> ... >>> } >> >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >
Nevermind, I have everything working now! You need to include: url.rewrite = ( "^/([\-_a-zA-Z0-9]+)/([\-_a-zA-Z0-9]+)/([\-_a-zA-Z0-9%]+)\??([\-_a-zA-Z0-9=&%]*)$" => "/dispatch.fcgi?controller=$1&action=$2&id=$3&$4", "^/([\-_a-zA-Z0-9]+)/([\-_a-zA-Z0-9]+)/?\??([\-_a-zA-Z0-9=&%]*)$" => "/dispatch.fcgi?controller=$1&action=$2&$3", "^/([\-_a-zA-Z0-9]+)/?\??([\-_a-zA-Z0-9=&%]*)$" => "/dispatch.fcgi?controller=$1&action=index&$2" ) In the lighttpd.conf despite what http://wiki.rubyonrails.com/rails/show/Lighttpd says. Regards, David Mytton Managing Director - Olate Ltd http://www.olate.co.uk T: (646) 257 3714 (USA) T: (020) 7870 9176 (UK) F: (0870) 705 1068 (UK) E: support-ELxQ3fsViAr10XsdtD+oqA@public.gmane.org David Mytton wrote:> I couldn''t get this to work so I used the hostname checking and I''m > still trying to get that to work properly. In the meantime, I wanted to > check out Typo so I set up Lighttpd to use just the 1 Rails app. I went > to http://www.example.com and then it redirected me to > http://www.example.com/accounts/signup, but I get a 404 Not Found error. > To me it sounds like the rewrite isn''t working correctly. Any idea how > to get that setup in Lighttpd? > > Regards, > > David Mytton > Managing Director - Olate Ltd > http://www.olate.co.uk > > T: (646) 257 3714 (USA) T: (020) 7870 9176 (UK) > F: (0870) 705 1068 (UK) E: support-ELxQ3fsViAr10XsdtD+oqA@public.gmane.org > > > > Jake Good wrote: > >> In your public/.htaccess of your RAILS application... place this above >> the RewriteRule section >> >> RewriteCond %{REQUEST URI} !^/blog* >> >> I think that might work (untested), though whatever is taking care of >> sending the requests to your virtual hosts should be doing this anyway.. >> >> Jake >> >> David Mytton wrote: >> >>> Yeh, I might have to do that if I can''t get it working - but I was >>> hoping to be able to use http://www.example.com/blog >>> >>> Regards, >>> >>> David Mytton >>> Managing Director - Olate Ltd >>> http://www.olate.co.uk >>> >>> T: (646) 257 3714 (USA) T: (020) 7870 9176 (UK) >>> F: (0870) 705 1068 (UK) E: support-ELxQ3fsViAr10XsdtD+oqA@public.gmane.org >>> >>> >>> >>> Ben Myles wrote: >>> >>>> Hi, >>>> >>>> If you want to make your life much simpler you could just use a >>>> subdomain, eg. "blog.example.com". >>>> >>>> Then just have something like: >>>> >>>> $HTTP["host"] == "blog.example.com" { >>>> ... >>>> } >>> >>> >>> >>> _______________________________________________ >>> Rails mailing list >>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails >>> >> >
When you say "everything" are you referring to the original thread topic (Multiple Docroots)? If so, could you try and post a run through of your configuration changes? On 8/15/05, David Mytton <david-nkCc03+qR4SsTnJN9+BGXg@public.gmane.org> wrote:> > Nevermind, I have everything working now! You need to include: > > url.rewrite = ( > > > "^/([\-_a-zA-Z0-9]+)/([\-_a-zA-Z0-9]+)/([\-_a-zA-Z0-9%]+)\??([\-_a-zA-Z0-9=&%]*)$" > => > "/dispatch.fcgi?controller=$1&action=$2&id=$3&$4", > "^/([\-_a-zA-Z0-9]+)/([\-_a-zA-Z0-9]+)/?\??([\-_a-zA-Z0-9=&%]*)$" => > "/dispatch.fcgi?controller=$1&action=$2&$3", > "^/([\-_a-zA-Z0-9]+)/?\??([\-_a-zA-Z0-9=&%]*)$" => > "/dispatch.fcgi?controller=$1&action=index&$2" > ) > > In the lighttpd.conf despite what > http://wiki.rubyonrails.com/rails/show/Lighttpd says. > > Regards, > > David Mytton > Managing Director - Olate Ltd > http://www.olate.co.uk > > T: (646) 257 3714 (USA) T: (020) 7870 9176 (UK) > F: (0870) 705 1068 (UK) E: support-ELxQ3fsViAr10XsdtD+oqA@public.gmane.org > > > > David Mytton wrote: > > I couldn''t get this to work so I used the hostname checking and I''m > > still trying to get that to work properly. In the meantime, I wanted to > > check out Typo so I set up Lighttpd to use just the 1 Rails app. I went > > to http://www.example.com and then it redirected me to > > http://www.example.com/accounts/signup, but I get a 404 Not Found error. > > To me it sounds like the rewrite isn''t working correctly. Any idea how > > to get that setup in Lighttpd? > > > > Regards, > > > > David Mytton > > Managing Director - Olate Ltd > > http://www.olate.co.uk > > > > T: (646) 257 3714 (USA) T: (020) 7870 9176 (UK) > > F: (0870) 705 1068 (UK) E: support-ELxQ3fsViAr10XsdtD+oqA@public.gmane.org > > > > > > > > Jake Good wrote: > > > >> In your public/.htaccess of your RAILS application... place this above > >> the RewriteRule section > >> > >> RewriteCond %{REQUEST URI} !^/blog* > >> > >> I think that might work (untested), though whatever is taking care of > >> sending the requests to your virtual hosts should be doing this > anyway.. > >> > >> Jake > >> > >> David Mytton wrote: > >> > >>> Yeh, I might have to do that if I can''t get it working - but I was > >>> hoping to be able to use http://www.example.com/blog > >>> > >>> Regards, > >>> > >>> David Mytton > >>> Managing Director - Olate Ltd > >>> http://www.olate.co.uk > >>> > >>> T: (646) 257 3714 (USA) T: (020) 7870 9176 (UK) > >>> F: (0870) 705 1068 (UK) E: support-ELxQ3fsViAr10XsdtD+oqA@public.gmane.org > >>> > >>> > >>> > >>> Ben Myles wrote: > >>> > >>>> Hi, > >>>> > >>>> If you want to make your life much simpler you could just use a > >>>> subdomain, eg. "blog.example.com <http://blog.example.com>". > >>>> > >>>> Then just have something like: > >>>> > >>>> $HTTP["host"] == "blog.example.com <http://blog.example.com>" { > >>>> ... > >>>> } > >>> > >>> > >>> > >>> _______________________________________________ > >>> Rails mailing list > >>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > >>> http://lists.rubyonrails.org/mailman/listinfo/rails > >>> > >> > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Yes. I''m still trying to get multiple hostnames to be recognised by the server but I can get 1 rails app to be served. Once I have this issue sorted I intend to write a full tutorial on getting it all set up with Lighttpd with Apache as a proxy forwarder (I have cpanel on my server). Regards, David Mytton Managing Director - Olate Ltd http://www.olate.co.uk T: (646) 257 3714 (USA) T: (020) 7870 9176 (UK) F: (0870) 705 1068 (UK) E: support-ELxQ3fsViAr10XsdtD+oqA@public.gmane.org Colin Ramsay wrote:> When you say "everything" are you referring to the original thread topic > (Multiple Docroots)? If so, could you try and post a run through of your > configuration changes? > > On 8/15/05, *David Mytton* <david-nkCc03+qR4SsTnJN9+BGXg@public.gmane.org <mailto:david-nkCc03+qR4SsTnJN9+BGXg@public.gmane.org>> > wrote: > > Nevermind, I have everything working now! You need to include: > > url.rewrite = ( > > "^/([\-_a-zA-Z0-9]+)/([\-_a-zA-Z0-9]+)/([\-_a-zA-Z0-9%]+)\??([\-_a-zA-Z0-9=&%]*)$" > => > "/dispatch.fcgi?controller=$1&action=$2&id=$3&$4", > "^/([\-_a-zA-Z0-9]+)/([\-_a-zA-Z0-9]+)/?\??([\-_a-zA-Z0-9=&%]*)$" => > "/dispatch.fcgi?controller=$1&action=$2&$3", > "^/([\-_a-zA-Z0-9]+)/?\??([\-_a-zA-Z0-9=&%]*)$" => > "/dispatch.fcgi?controller=$1&action=index&$2" > ) > > In the lighttpd.conf despite what > http://wiki.rubyonrails.com/rails/show/Lighttpd > <http://wiki.rubyonrails.com/rails/show/Lighttpd> says. > > Regards, > > David Mytton > Managing Director - Olate Ltd > http://www.olate.co.uk > > T: (646) 257 3714 (USA) T: (020) 7870 9176 (UK) > F: (0870) 705 1068 (UK) E: support-ELxQ3fsViAr10XsdtD+oqA@public.gmane.org > <mailto:support-ELxQ3fsViAr10XsdtD+oqA@public.gmane.org> > > > > David Mytton wrote: > > I couldn''t get this to work so I used the hostname checking and I''m > > still trying to get that to work properly. In the meantime, I > wanted to > > check out Typo so I set up Lighttpd to use just the 1 Rails app. > I went > > to http://www.example.com and then it redirected me to > > http://www.example.com/accounts/signup, but I get a 404 Not Found > error. > > To me it sounds like the rewrite isn''t working correctly. Any > idea how > > to get that setup in Lighttpd? > > > > Regards, > > > > David Mytton > > Managing Director - Olate Ltd > > http://www.olate.co.uk > > > > T: (646) 257 3714 (USA) T: (020) 7870 9176 (UK) > > F: (0870) 705 1068 (UK) E: support-ELxQ3fsViAr10XsdtD+oqA@public.gmane.org > <mailto:support-ELxQ3fsViAr10XsdtD+oqA@public.gmane.org> > > > > > > > > Jake Good wrote: > > > >> In your public/.htaccess of your RAILS application... place this > above > >> the RewriteRule section > >> > >> RewriteCond %{REQUEST URI} !^/blog* > >> > >> I think that might work (untested), though whatever is taking > care of > >> sending the requests to your virtual hosts should be doing this > anyway.. > >> > >> Jake > >> > >> David Mytton wrote: > >> > >>> Yeh, I might have to do that if I can''t get it working - but I was > >>> hoping to be able to use http://www.example.com/blog > >>> > >>> Regards, > >>> > >>> David Mytton > >>> Managing Director - Olate Ltd > >>> http://www.olate.co.uk <http://www.olate.co.uk> > >>> > >>> T: (646) 257 3714 (USA) T: (020) 7870 9176 (UK) > >>> F: (0870) 705 1068 (UK) E: support-ELxQ3fsViAr10XsdtD+oqA@public.gmane.org > <mailto:support-ELxQ3fsViAr10XsdtD+oqA@public.gmane.org> > >>> > >>> > >>> > >>> Ben Myles wrote: > >>> > >>>> Hi, > >>>> > >>>> If you want to make your life much simpler you could just use a > >>>> subdomain, eg. " blog.example.com <http://blog.example.com>". > >>>> > >>>> Then just have something like: > >>>> > >>>> $HTTP["host"] == " blog.example.com <http://blog.example.com>" { > >>>> ... > >>>> } > >>> > >>> > >>> > >>> _______________________________________________ > >>> Rails mailing list > >>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org <mailto:Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org> > >>> http://lists.rubyonrails.org/mailman/listinfo/rails > <http://lists.rubyonrails.org/mailman/listinfo/rails> > >>> > >> > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org <mailto:Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org> > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Excellent. Thanks for your work so far, and I look forward to seeing the tutorial. On 8/16/05, David Mytton <david-nkCc03+qR4SsTnJN9+BGXg@public.gmane.org> wrote:> > Yes. I''m still trying to get multiple hostnames to be recognised by the > server but I can get 1 rails app to be served. Once I have this issue > sorted I intend to write a full tutorial on getting it all set up with > Lighttpd with Apache as a proxy forwarder (I have cpanel on my server). > > Regards, > > David Mytton > Managing Director - Olate Ltd > http://www.olate.co.uk > > T: (646) 257 3714 (USA) T: (020) 7870 9176 (UK) > F: (0870) 705 1068 (UK) E: support-ELxQ3fsViAr10XsdtD+oqA@public.gmane.org > > > > Colin Ramsay wrote: > > When you say "everything" are you referring to the original thread topic > > (Multiple Docroots)? If so, could you try and post a run through of your > > configuration changes? > > > > On 8/15/05, *David Mytton* <david-nkCc03+qR4SsTnJN9+BGXg@public.gmane.org <mailto:david-nkCc03+qR4SsTnJN9+BGXg@public.gmane.org>> > > wrote: > > > > Nevermind, I have everything working now! You need to include: > > > > url.rewrite = ( > > > > > "^/([\-_a-zA-Z0-9]+)/([\-_a-zA-Z0-9]+)/([\-_a-zA-Z0-9%]+)\??([\-_a-zA-Z0-9=&%]*)$" > > => > > "/dispatch.fcgi?controller=$1&action=$2&id=$3&$4", > > "^/([\-_a-zA-Z0-9]+)/([\-_a-zA-Z0-9]+)/?\??([\-_a-zA-Z0-9=&%]*)$" => > > "/dispatch.fcgi?controller=$1&action=$2&$3", > > "^/([\-_a-zA-Z0-9]+)/?\??([\-_a-zA-Z0-9=&%]*)$" => > > "/dispatch.fcgi?controller=$1&action=index&$2" > > ) > > > > In the lighttpd.conf despite what > > http://wiki.rubyonrails.com/rails/show/Lighttpd > > <http://wiki.rubyonrails.com/rails/show/Lighttpd> says. > > > > Regards, > > > > David Mytton > > Managing Director - Olate Ltd > > http://www.olate.co.uk > > > > T: (646) 257 3714 (USA) T: (020) 7870 9176 (UK) > > F: (0870) 705 1068 (UK) E: support-ELxQ3fsViAr10XsdtD+oqA@public.gmane.org > > <mailto:support-ELxQ3fsViAr10XsdtD+oqA@public.gmane.org> > > > > > > > > David Mytton wrote: > > > I couldn''t get this to work so I used the hostname checking and I''m > > > still trying to get that to work properly. In the meantime, I > > wanted to > > > check out Typo so I set up Lighttpd to use just the 1 Rails app. > > I went > > > to http://www.example.com and then it redirected me to > > > http://www.example.com/accounts/signup, but I get a 404 Not Found > > error. > > > To me it sounds like the rewrite isn''t working correctly. Any > > idea how > > > to get that setup in Lighttpd? > > > > > > Regards, > > > > > > David Mytton > > > Managing Director - Olate Ltd > > > http://www.olate.co.uk > > > > > > T: (646) 257 3714 (USA) T: (020) 7870 9176 (UK) > > > F: (0870) 705 1068 (UK) E: support-ELxQ3fsViAr10XsdtD+oqA@public.gmane.org > > <mailto:support-ELxQ3fsViAr10XsdtD+oqA@public.gmane.org> > > > > > > > > > > > > Jake Good wrote: > > > > > >> In your public/.htaccess of your RAILS application... place this > > above > > >> the RewriteRule section > > >> > > >> RewriteCond %{REQUEST URI} !^/blog* > > >> > > >> I think that might work (untested), though whatever is taking > > care of > > >> sending the requests to your virtual hosts should be doing this > > anyway.. > > >> > > >> Jake > > >> > > >> David Mytton wrote: > > >> > > >>> Yeh, I might have to do that if I can''t get it working - but I was > > >>> hoping to be able to use http://www.example.com/blog > > >>> > > >>> Regards, > > >>> > > >>> David Mytton > > >>> Managing Director - Olate Ltd > > >>> http://www.olate.co.uk <http://www.olate.co.uk> > > >>> > > >>> T: (646) 257 3714 (USA) T: (020) 7870 9176 (UK) > > >>> F: (0870) 705 1068 (UK) E: support-ELxQ3fsViAr10XsdtD+oqA@public.gmane.org > > <mailto:support-ELxQ3fsViAr10XsdtD+oqA@public.gmane.org> > > >>> > > >>> > > >>> > > >>> Ben Myles wrote: > > >>> > > >>>> Hi, > > >>>> > > >>>> If you want to make your life much simpler you could just use a > > >>>> subdomain, eg. " blog.example.com <http://blog.example.com> < > http://blog.example.com>". > > >>>> > > >>>> Then just have something like: > > >>>> > > >>>> $HTTP["host"] == " blog.example.com <http://blog.example.com> < > http://blog.example.com>" { > > >>>> ... > > >>>> } > > >>> > > >>> > > >>> > > >>> _______________________________________________ > > >>> Rails mailing list > > >>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org <mailto:Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org> > > >>> http://lists.rubyonrails.org/mailman/listinfo/rails > > <http://lists.rubyonrails.org/mailman/listinfo/rails> > > >>> > > >> > > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org <mailto:Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org> > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails