How to make virtual hosts in mongrel? ::how to serve example1.tld, example2.tld, .. exampleN.tld's different ruby apps? thanks in advence frikazojd. <a href="http://ad.adverticum.net/b/cl,1,73468,1598288,1592431/click.prm" target="_blank">________________________________________________________<br>?jdons?g! Meg?rkezett a RIGHT GUARD f?rfi test?pol?si term?kcsal?d! Most 25% kedvezm?nnyel! Ak?r 48 ?r?s hat?sos v?delem a testszag ellen!<br></a> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/mongrel-users/attachments/20100324/0b9193ed/attachment.html>
Jonathan Rochkind
2010-Mar-24 19:34 UTC
[Mongrel] VirtualHost like in the Apache-PHP world
You do it all in Apache. Typical way to deploy mongrel is fronted with an Apache reverse proxy. You need to set up everything in Apache, and have the right requests proxied to the right mongrel. It''s all about apache, no config in Mongrel. You may also want to consider mod_rails/passenger instead of mongrel, it seems to be more popular these days for Rails deployment, and you may find it easier to set up the way you want. Jonathan Nagy Tam?s wrote:> How to make virtual hosts in mongrel? > > ::how to serve example1.tld, example2.tld, .. exampleN.tld''s different ruby apps? > > thanks in advence > frikazojd. > > > ________________________________________________________ > ?jdons?g! Meg?rkezett a RIGHT GUARD f?rfi test?pol?si term?kcsal?d! Most 25% kedvezm?nnyel! Ak?r 48 ?r?s hat?sos v?delem a testszag ellen! <http://ad.adverticum.net/b/cl,1,73468,1598288,1592431/click.prm> > >
Thank you, Jonathan! but i'd like to try out Mongrel..so, I set the apache with mod_proxy.. i think it should forward the request to mongrel, localhost:3000.. but how will the mongrel figure out where are the ruby apps? it will get a request for example.tld or example6.tld and example4.tld at the same time.. .. ?? Jonathan Rochkind <rochkind at jhu.edu> ?rta:>You do it all in Apache. Typical way to deploy mongrel is fronted with >an Apache reverse proxy. You need to set up everything in Apache, and >have the right requests proxied to the right mongrel. It's all about >apache, no config in Mongrel. > >You may also want to consider mod_rails/passenger instead of mongrel, it >seems to be more popular these days for Rails deployment, and you may >find it easier to set up the way you want. > >Jonathan ><a href="http://ad.adverticum.net/b/cl,1,73468,1598288,1592431/click.prm" target="_blank">________________________________________________________<br>?jdons?g! Meg?rkezett a RIGHT GUARD f?rfi test?pol?si term?kcsal?d! Most 25% kedvezm?nnyel! Ak?r 48 ?r?s hat?sos v?delem a testszag ellen!<br></a> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/mongrel-users/attachments/20100324/b821a3f6/attachment.html>
2010/3/24 Nagy Tam?s <frikazojd at freemail.hu>:> but i''d like to try out Mongrel.. > so, I set the apache with mod_proxy.. i think it should forward the request > to mongrel, localhost:3000.. but how will the mongrel figure out where are > the ruby apps? it will get a request for example.tld or example6.tld and > example4.tld at the same time.. .. ??You need to have at least one mongrel instance per domain, and set up your httpd proxy accordingly. -- Hassan Schroeder ------------------------ hassan.schroeder at gmail.com twitter: @hassan
On 24 Mar 2010, at 22:13, Hassan Schroeder wrote:> 2010/3/24 Nagy Tam?s <frikazojd at freemail.hu>: > >> but i''d like to try out Mongrel.. >> so, I set the apache with mod_proxy.. i think it should forward the request >> to mongrel, localhost:3000.. but how will the mongrel figure out where are >> the ruby apps? it will get a request for example.tld or example6.tld and >> example4.tld at the same time.. .. ?? > > You need to have at least one mongrel instance per domain, and set > up your httpd proxy accordingly.Actually, you can use rack to do it: map "http://domain1/" do run App1 end map "http://domain2/" do run App2 end Then specify multiple vhost aliases in the apache proxy configuration> > -- > Hassan Schroeder ------------------------ hassan.schroeder at gmail.com > twitter: @hassan > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users-------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3679 bytes Desc: not available URL: <http://rubyforge.org/pipermail/mongrel-users/attachments/20100325/6d3f12c4/attachment.bin>
Thank you Hassan, James! So i will need one mongrel per domain. I think I can't carry out this because I have a thousands of domains. I think i will try the rack-thing James mentioned. I assume i can't run individual ruby script files but whole apps, one app for one domain. ooohh so hard.. :) <a href="http://ad.adverticum.net/b/cl,1,73468,1598288,1592431/click.prm" target="_blank">________________________________________________________<br>?jdons?g! Meg?rkezett a RIGHT GUARD f?rfi test?pol?si term?kcsal?d! Most 25% kedvezm?nnyel! Ak?r 48 ?r?s hat?sos v?delem a testszag ellen!<br></a> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/mongrel-users/attachments/20100325/6f63a0b3/attachment.html>
Jonathan Rochkind
2010-Mar-25 14:52 UTC
[Mongrel] VirtualHost like in the Apache-PHP world
Do you want a seperate app per domain, or do you want one app handling multiple domains? If you want a seperate app per domain, I think you''d need a mongrel per domain too, I don''t see any other way to do it. If you want one app that handles multiple domains, than it''s up to you to write an app that can do that, and it''s not a mongrel issue. Jonathan Nagy Tam?s wrote:> Thank you Hassan, James! > > So i will need one mongrel per domain. I think I can''t carry out this because I have a thousands of domains. > > I think i will try the rack-thing James mentioned. I assume i can''t run individual ruby script files but whole apps, one app for one domain. > > ooohh so hard.. :) > > > ________________________________________________________ > ?jdons?g! Meg?rkezett a RIGHT GUARD f?rfi test?pol?si term?kcsal?d! Most 25% kedvezm?nnyel! Ak?r 48 ?r?s hat?sos v?delem a testszag ellen! <http://ad.adverticum.net/b/cl,1,73468,1598288,1592431/click.prm> > >
On 25 Mar 2010, at 14:34, Nagy Tam?s wrote:> Thank you Hassan, James! > > So i will need one mongrel per domain. I think I can''t carry out this because I have a thousands of domains.That sounds like a recipe for out of memory errors and cross-application errors taking down the whole set at the same time. It also sounds like it''s better suited to passenger.> I think i will try the rack-thing James mentioned. I assume i can''t run individual ruby script files but whole apps, one app for one domain.You can load whatever you like, and run anything that responds to #call, in the standard rack manner. What you won''t be able to do, is load different versions of dependencies into the same process and expect to be bug free.> ooohh so hard.. :) > > > ________________________________________________________ > ?jdons?g! Meg?rkezett a RIGHT GUARD f?rfi test?pol?si term?kcsal?d! Most 25% kedvezm?nnyel! Ak?r 48 ?r?s hat?sos v?delem a testszag ellen! _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/mongrel-users/attachments/20100325/fb808395/attachment-0001.html>
On 25 Mar 2010, at 14:52, Jonathan Rochkind wrote:> Do you want a seperate app per domain, or do you want one app handling multiple domains? > > If you want a seperate app per domain, I think you''d need a mongrel per domain too, I don''t see any other way to do it.map "http://domain1.com/" do run App1.new end map "http://domain2.com/" do run App2.new end I see a way to do it.> > If you want one app that handles multiple domains, than it''s up to you to write an app that can do that, and it''s not a mongrel issue. > > Jonathan > > Nagy Tam?s wrote: >> Thank you Hassan, James! >> >> So i will need one mongrel per domain. I think I can''t carry out this because I have a thousands of domains. >> >> I think i will try the rack-thing James mentioned. I assume i can''t run individual ruby script files but whole apps, one app for one domain. >> >> ooohh so hard.. :) >> >> >> ________________________________________________________ >> ?jdons?g! Meg?rkezett a RIGHT GUARD f?rfi test?pol?si term?kcsal?d! Most 25% kedvezm?nnyel! Ak?r 48 ?r?s hat?sos v?delem a testszag ellen! <http://ad.adverticum.net/b/cl,1,73468,1598288,1592431/click.prm> >> >> > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users
On Thu, Mar 25, 2010 at 2:04 PM, James Tucker <jftucker at gmail.com> wrote:> map "http://domain1.com/" do > ?run App1.new > end > > map "http://domain2.com/" do > ?run App2.new > end > > I see a way to do it.OK, I''ve never used Rack as a standalone entity; how exactly does this work in a Rails context? Say, I have a directory structure like /webapps/app1 /webapps/app2 where both app1 and app2 are Rails apps. Where does the above code go, and what exactly would I be invoking? -- Hassan Schroeder ------------------------ hassan.schroeder at gmail.com twitter: @hassan
Ok, then it will be Rack. anyway, i want to use the whole ruby as php: example.tld/rubyscript1.rbexample.tld/rubyscript2.rbexample2.tld/rubyappexample2.tld/rubyapp/rubyscript.rb where also works any Rails app.. <a href="http://ad.adverticum.net/b/cl,1,73468,1598288,1592431/click.prm" target="_blank">________________________________________________________<br>?jdons?g! Meg?rkezett a RIGHT GUARD f?rfi test?pol?si term?kcsal?d! Most 25% kedvezm?nnyel! Ak?r 48 ?r?s hat?sos v?delem a testszag ellen!<br></a> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/mongrel-users/attachments/20100326/4b3c5f22/attachment.html>