You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "T.J. Mather" <tj...@anidea.com> on 2000/12/27 17:42:03 UTC

prob with dir_config at server startup

I'm having a problem accessing PerlSetVar variables with
Apache->server->dir_config at server startup.  I'm using the lastest
versions of mod_perl 1.24_01 and apache (1.3.14).

The problem occurs when I use PerlSetVar inside a Directory, Location or
Files section:

in httpd.conf:
<Location />
PerlSetVar PKIT_ROOT /home/tjmather/Apache-PageKit/eg
</Location>

perl startup code:
my $pkit_root = Apache->server->dir_config('PKIT_ROOT');
# $pkit_root = undef

But if I remove the Location directive, then it works fine:

in httpd.conf:
PerlSetVar PKIT_ROOT /home/tjmather/Apache-PageKit/eg

perl startup code:
my $pkit_root = Apache->server->dir_config('PKIT_ROOT');
# $pkit_root = '/home/tjmather/Apache-PageKit/eg'

Any ideas?


Re: prob with dir_config at server startup

Posted by John K Sterling <st...@covalent.net>.
the per_dir_configs (i.e. <Location> PerlSetVar) are not accessabled from
the Apache::Server.  They are only accessable from
Apache::Request::dir_config.  It makes sense if you think about it - a
per_dir config can be different for each Location.  If you need any config
values in a PerlInitHandler, you need to specify them outside the location
tags.

sterling

"T.J. Mather" wrote:

> I'm having a problem accessing PerlSetVar variables with
> Apache->server->dir_config at server startup.  I'm using the lastest
> versions of mod_perl 1.24_01 and apache (1.3.14).
>
> The problem occurs when I use PerlSetVar inside a Directory, Location or
> Files section:
>
> in httpd.conf:
> <Location />
> PerlSetVar PKIT_ROOT /home/tjmather/Apache-PageKit/eg
> </Location>
>
> perl startup code:
> my $pkit_root = Apache->server->dir_config('PKIT_ROOT');
> # $pkit_root = undef
>
> But if I remove the Location directive, then it works fine:
>
> in httpd.conf:
> PerlSetVar PKIT_ROOT /home/tjmather/Apache-PageKit/eg
>
> perl startup code:
> my $pkit_root = Apache->server->dir_config('PKIT_ROOT');
> # $pkit_root = '/home/tjmather/Apache-PageKit/eg'
>
> Any ideas?