
diment at gmail
Jul 12, 2009, 12:54 AM
Post #4 of 9
(1458 views)
Permalink
|
On 12/07/2009, at 5:29 PM, Mihai Bazon wrote: > Kieren Diment <diment [at] gmail> wrote: >> >> On 12/07/2009, at 4:35 PM, Mihai Bazon wrote: >> >>> Hi folks, >>> >>> I think this was raised before but I don't remember to have seen a >>> satisfactory answer. Someone please point me into the right >>> direction. >>> >>> I want to deploy a Catalyst app that will be used to serve multiple >>> websites. The platform will be Apache2 (prefork) + mod_perl2. I >>> want >>> Catalyst to read a different configuration file, based on the host >>> name. >>> Each virtual host will have its own database (configured in .conf) >>> and >>> its own "root" directory, but other than this, all the Perl modules >>> are >>> the same. >>> >>> I know this can be done with FastCGI by launching a different >>> process >>> for each host, but I'm interested in a mod_perl solution. Is it >>> feasible? >> >> >> One of the limitations of mod_perl is that you can't run the same app >> more than once on the same server. Sorry. > > Let me clarify that. I don't want to run the app more than once. I > just want the application to switch configuration file and database > depending on the hostname that each particular request targets. > > I've done this a zillion times with plain mod_perl, I just don't know > what's the proper route with Catalyst. Possibly to pick up some particular config that's chosen on the basis of the value of $c->req->host? $c->config( host_config => {example.com => [qw/foo bar/], superbad.com => [qw/ fred wilma/} Or if you need something more dynamic, put some configuration grabbing routine in auto in Controller::Root. _______________________________________________ List: Catalyst [at] lists Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst [at] lists/ Dev site: http://dev.catalyst.perl.org/
|