On Sun, 11 Feb 2001, Marc Lehmann wrote:
> I have two problems related to setting Location directives from within
> perl sections that I don't understand (I've looked at the mod_perl guide
> and the archive but a RTFM is certainly welcome ;)
>
> First problem: <Location> works on url space only while $Location
> requires existing directories (full httpd.conf atatched):
>
> DocumentRoot /tmp
>
> <Location /perl-status>
> SetHandler perl-script
> PerlHandler Apache::Status
> </Location>
>
> <Perl>
> $Location{'/test'} = {
> SetHandler => 'perl-script',
> PerlHandler => "Apache::Status",
> };
> </Perl>
>
> The first location works fine. The second one doesn't UNTIL I mkdir
> /tmp/test (there is no /tmp/perl-status), after which I get the
> perl-status page on both urls.
Looks like Apache doing stat() calls problem. Try to run the request under
strace(1) or truss(1). See:
http://perl.apache.org/guide/performance.html#Reducing_the_Number_of_stat_Ca
> The second problem (which I can't reproduce with a small example) is that,
> when using a lot of entries in %Location, they suddenly start to behave
> like LocationMatch, i.e.:
>
> $Location{'/admin'} = { ... };
>
> matches /test/admin, /something/else/admin/jump, /cgi-bin/printenv/admin
> and everything else that contains /admin IFF the url does not directly
> point to something hat can be displayed (e.g. the printenv is a cgi script
> but it doesn't get called).
>
> If I change this to:
>
> $Location{'^/admin'} = { ... };
>
> it suddenly starts to work as expected, indeed as if LocationMatch was
> used. However, this is not deterministic. Sometimes the above simply
> matches nothing ;)
>
> Does this ring a bell for somebody? I ahd the same problem with
> apache-1.3.14 and mod_perl-1.24 I upgraded to apache-1.3.17 and modperl
> from cvs but the symptoms didn't change so I guess it might not be a bug
> but rather some misunderstanding on my side :(
Again, what strace tells you? You will see everything that Apache does
while looking at the output.
_____________________________________________________________________
Stas Bekman JAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide http://perl.apache.org/guide
mailto:[EMAIL PROTECTED] http://apachetoday.com http://logilune.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/