The obvious (though perhaps not the best) way to do this is to have the
Rails app create a new virtual host block in the apache config for each
one of these content providers and their subdomain.
My concern is that the vHosts in Apache were probably designed as a way
to have two or three, maybe a half dozen or more separate things running
on the server...but a few thousand?!?!?!?!
Does anyone have any experience putting thousands of vHosts into an
apache config? Does this scale that high without creating some sort of
stability or speed problems? Do you need gobs 'o RAM for the apache
server to keep track of all those vHosts? Does it take hours for the
Apache server to start up?
Does anyone have a suggestion for a much better way to do this? Am I
re-inventing an existing wheel?
many thanks for your wisdom.
thanks,
jp
--
Posted via http://www.ruby-forum.com/.
Then in rails you can access the subdomain(s) via request.subdomains
A similar approach is spelled out at:
http://wiki.rubyonrails.org/rails/pages/HowToUseSubdomainsAsAccountKeys
Very cool! Thanks Shawn!
I wonder, can you do *.* and also get the domain?
(naturally, he wants to allow some customers to register a domain name
and use that as well)
thanks again!
On RubyForge we have over 6000 virtual hosts configured inside one
Apache server and haven't seen any problems. Restarts take 10-15
seconds. The machine has 8 GB of RAM, but Apache doesn't use much of it
since the virtual hosts are mostly static content.
Yours,
Tom
That said, I think Shawn's suggestion is probably the way to go,
Yours,
Tom
Thanks Tom. Interesting that it can handle that many with ease.
May use Shawn's method for the subdomains and vHosts for all of the
user-registered domains.