perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Garrison <...@jhmg.net>
Subject PerlSetVar inside <Location> doesn't seem to work
Date Thu, 16 Jul 2015 00:07:52 GMT
I have the following config


>     <VirtualHost [redacted]:80>
> 
>         ...
> 
>         PerlOptions +Parent
>         PerlSwitches -T -w -I/home/pdxep/gallery
> 
>         PerlModule Apache2::Reload
>         PerlModule Album
>         PerlModule env
> 
>         <Location /gallery>
> 
>             PerlInitHandler Apache2::Reload
> 
>             PerlSetVar app_dir      /var/webapp
>             PerlSetVar template_dir /templates
>             PerlSetVar albums_dir   /albums
>             PerlSetVar static_url   /static
>             PerlSetVar albums_url   /albums
> 
>             SetHandler perl-script
>             PerlResponseHandler Album
> 
>         </Location>
> 
>         <Location /env>
>             SetHandler perl-script
>             PerlResponseHandler env
>         </location>
> 
>     </VirtualHost>

My handler script (Album.pm) retrieves the variables with

    my $s = Apache2::ServerUtil->server;
    my $app_dir      = $s->dir_config('app_dir');
    my $template_dir = $app_dir . $s->dir_config('template_dir');

However it's getting empty strings for the values.  This was working
when the PerlSetVar directives were outside the VirtualHost block.

According to the documentation

https://perl.apache.org/docs/2.0/user/config/config.html#mod_perl_Directives_Argument_Types_and_Allowed_Location

PerlSetVar is scoped "DIR" meaning it can appear in Directory,
Location or Files blocks.  What am I doing wrong?

-- 
Jim Garrison (jhg@acm.org)
PGP Keys at http://www.jhmg.net RSA 0x04B73B7F DH 0x70738D88

Mime
View raw message