[Mongrel] Mass virtual hosting with mongrel

John Clayton john at fivesquaresoftware.com
Thu Sep 7 14:40:50 EDT 2006


Ok, a refinement of the question I asked yesterday (If there were any  
replies from yesterday I don't have access to them here .. sorry if  
I'm duplicating anybody's words here).

How can one host multiple domains with mongrel? Assuming you are mass  
vhosting and you also want the performance benefits of using mongrel ...

As far as I can tell, one could set up a vhost in Apache and a  
mongrel (cluster) for each host and have that be that. But let's say  
you can have an unlimited number of vhosts, this will get seriously  
tedious and error prone.

A great thing about Apache is the ability to interpolate docroots, so  
you can add infinite vhosts super easy. But, for this to work with  
Mongrel, it would have to have the same ability, be able to take a  
request and feed it to the correct app based on some parameters of  
the request.

I haven't yet looked at Mongrel's internals, but for those of you  
with experience there, would it be difficult or is it even a good  
idea to create a parallel to mongrel_rails, something like  
mongrel_rails_vhosts or the like? My understanding of plugins is that  
they can only extend mongrel_rails by adding commands, true? I  
imagine it would be similar to mongrel_rails but with a dispatcher  
layer that can be multithreaded and send requests to the correct app  
based on the request. Or would something like mongrel_cluster, but  
with the added dispatching layer there be a better approach?

Love to hear anyone's thoughts ... if it seems promising, I'll take  
it on.

Cheers,

John



More information about the Mongrel-users mailing list