[Catalyst] Configuration based on hostname

Carl Johnstone catalyst at fadetoblack.me.uk
Mon Jul 13 14:02:24 GMT 2009


Mihai Bazon wrote:
> 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.

We do it with multiple vhosts running the same catalyst app, then in 
Root->auto of the app we check

$c->apache->server->server_hostname

which provides the servername for the vhost as in the apache config. 
Checking the ServerName means that we can ignore any alternate domains 
configured using a ServerAlias directive.

Carl




More information about the Catalyst mailing list