You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Philippe M. Chiasson" <go...@cpan.org> on 2004/04/06 21:24:00 UTC

Re: Setting a perl variable in a VirtualHost via a section

On Wed, 2004-03-31 at 15:34 -0500, Mark Doyle wrote:
> Greetings,
> 
> I haven't been able to figure this one out from the available 
> documentation
> and guide. This mod_perl 1.2X...
> 
> Currently I have a bunch of virtual hosts with configs like:
> 
> <VirtualHost XXXXXXXXX:80>
>    ServerName foo.aps.org
>    PerlSetVar APSProduct "FOO"
>    DocumentRoot /FOO
>    ResourceConfig conf/homepage.conf
> </VirtualHost>
> 
> which I want to replace with
> 
> <Perl>
> foreach my $host (keys %ips) {
>      my $HOST = uc $host;
>      $VirtualHost{$ips{$host}} = {
>          ServerName => $host . $domain,
>          DocumentRoot => "/$HOST",
>          ResourceConfig => 'conf/homepage.conf',

	   PerlSetVar => [ "ASPProduct", $asp{$host} ];

>      }
> }
> </Perl>
> 
> How can I add the PerlSetVar APSProduct "FOO" to the <Perl> section? 
> The value
> of the variable depends on the virtual host of course.
> 
> Cheers,
> Mark
> 
> 
> -- 
> Report problems: http://perl.apache.org/bugs/
> Mail list info: http://perl.apache.org/maillist/modperl.html
> List etiquette: http://perl.apache.org/maillist/email-etiquette.html
-- 
--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/     F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5