[Catalyst] Re: Multi Mod_Perl apps

Adam Sjøgren asjo at koldfront.dk
Wed Aug 8 15:59:39 GMT 2007


On Wed, 8 Aug 2007 06:14:54 -0700 (PDT), Will wrote:

>  Sorry if I post an old question, I just want to know if I could do
>  this to run multi app on the same server under mod_perl:
 
>     PerlSwitches -I/var/www/MyApp1/lib
>     PerlModule MyApp1
    
>     <Location />
>         SetHandler          modperl
>         PerlResponseHandler MyApp1
>     </Location>

>     PerlSwitches -I/var/www/MyApp2/lib
>     PerlModule MyApp2
    
>     <Location />
>         SetHandler          modperl
>         PerlResponseHandler MyApp2
>     </Location>

Assuming that the <Location>-parts are in different virtual hosts (and
not as shown verbatim above), yes; that is what I do.

My site-configuration files basically looks like this (stuff omitted at
[...] for brevity):

,----[ /etc/apache2/sites-enabled/010-www.kammeratadam.dk ]
| PerlSwitches -I/var/www/www.kammeratadam.dk/lib
| PerlModule KammeratAdam
| 
| <VirtualHost *>
|     ServerName www.kammeratadam.dk
| [...]
| 
|     <Location />
|         SetHandler modperl
|         PerlResponseHandler KammeratAdam
|         ExpiresDefault "access plus 10 minutes"
|     </Location>
| 
|     <Location /grafik/>
|         SetHandler None
|         ExpiresDefault "access plus 1 week"
|     </Location>
| [...] 
| </VirtualHost>
`----

,----[ /etc/apache2/sites-enabled/010-www.vantbanken.se ]
| PerlSwitches -I/var/www/www.vantbanken.se/lib
| PerlModule Vantbanken
| 
| <VirtualHost *>
|     ServerName www.vantbanken.se
| [...]
| 
|     <Location />
|         SetHandler modperl
|         PerlResponseHandler Vantbanken
| 
|         AuthType Basic
|         AuthName "Not open yet"
|         AuthUserFile /var/www/www.vantbanken.se/conf/stats
|         Require valid-user
|     </Location>
| [...]
| </VirtualHost>
`----

>  My question is the PerlSwitches, will it get any error with that?

Not unless your apps have different local modules with the same names,
I'd guess?


  Best regards,

     Adam

-- 
 "KOMPRESSOR crush american burger"                           Adam Sjøgren
                                                         asjo at koldfront.dk



More information about the Catalyst mailing list