John Clayton
2006-Sep-06 23:02 UTC
[Mongrel] Running multiple domains on one codebase, mongrel a good choice?
We''re working on rails application for a client that needs to be deployed under a variety of domain names and needs the ability to load custom configurations for the database, parts of the docroot, caching, etc. based on the site we''re serving. We use mongrel to host some other single domain apps and would like to do so here too. We''d like to not have to deploy the codebase multiple times either (since it''s identical) so we''re trying to figure out a way maybe to load each instance into mongrel with different params and then let the instance configure itself. Does anyone have experience using mongrel in this way or similar? Thanks, John
Luis Lavena
2006-Sep-07 01:40 UTC
[Mongrel] Running multiple domains on one codebase, mongrel a good choice?
On 9/6/06, John Clayton <john at fivesquaresoftware.com> wrote:> We''re working on rails application for a client that needs to be > deployed under a variety of domain names and needs the ability to > load custom configurations for the database, parts of the docroot, > caching, etc. based on the site we''re serving. We use mongrel to > host some other single domain apps and would like to do so here too. > We''d like to not have to deploy the codebase multiple times either > (since it''s identical) so we''re trying to figure out a way maybe to > load each instance into mongrel with different params and then let > the instance configure itself.If your application is equal (or at least, only database and public/ configuration differ) you should check Fossilize plugin. Its too "crude", but John W. Long (Radiant CMS) implemented it in a better way to suit "instancing" based on gems or folders where you store the main code base and redirect to instances.> > Does anyone have experience using mongrel in this way or similar?Also, mongrel works good under this scenario. You should check the sample code and the docs about creating daemons for mongrel_cluster that load your specific root path.> > Thanks, > John > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users >-- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi
Jeroen Houben
2006-Sep-07 05:45 UTC
[Mongrel] Running multiple domains on one codebase, mongrel a good choice?
John Clayton wrote:> We''re working on rails application for a client that needs to be > deployed under a variety of domain names and needs the ability to > load custom configurations for the database, parts of the docroot, > caching, etc. based on the site we''re serving. We use mongrel to > host some other single domain apps and would like to do so here too. > We''d like to not have to deploy the codebase multiple times either > (since it''s identical) so we''re trying to figure out a way maybe to > load each instance into mongrel with different params and then let > the instance configure itself. > > Does anyone have experience using mongrel in this way or similar?I''m using different custum environments for different sites. Zed gave me that idea. I also have a mongrel_cluster.conf for each site that will load the correct environment. Then in my Apache vhost config I link the right site to the mongrel instances. I override a small method in rails to load assests from an site specific location instead of just public/ HTH, Jeroen