You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Michael J Schout <ms...@gkg.net> on 2001/02/14 22:23:01 UTC

Perl sections / Location problems

I've been scratching my head on this for quite a while and I cant seem to
figure it out.  I have a very stripped down configuration, which only contains
the following <Perl> section:

<Perl>
use Apache::Status;

$Location{"^/perl-status-1\$"} = {
  SetHandler  => 'perl-script',
  PerlHandler => 'Apache::Status'
};

$Location{"^/perl-status-2\$"} = {
  SetHandler  => 'perl-script',
  PerlHandler => 'Apache::Status'
};
</Perl>

If I start the server up, it appears to configure correctly, however, if I
access /perl-status-1 I get a 404 Not Found error.  If I access /perl-status-2,
then I get the expected Apache::Status output.  This is very repeatable in that
no matter what I shove into the Location hash if its a regexp, the first entry
doesnt work.

I'm running Apache 1.3.17, mod_ssl 2.8.0, perl 5.6.0, Linux 2.2.16

Anyone have any ideas?

I ran the server with MOD_PERL_TRACE=all as:
httpd -X -f /nis.home/mschout/httpd.conf.bug

during startup, the perl trace output is as follows:

perl_parse args: '/dev/null' ...allocating perl interpreter...ok
constructing perl interpreter...ok
ok
running perl interpreter...ok
mod_perl: 0 END blocks encountered during server startup
loading perl module 'Apache'...loading perl module 'Apache::Constants::Exports'...ok
ok
loading perl module 'Tie::IxHash'...ok
perl_section: </Files>
perl_section: <Location ^/perl-status-1$>
init `PerlHandler' stack
perl_cmd_push_handlers: @PerlHandler, 'Apache::Status'
pushing `Apache::Status' into `PerlHandler' handlers
PerlHandler Apache::Status (OK) Limit=no
SetHandler perl-script (OK) Limit=no
perl_section: <Location ^/perl-status-2$>
init `PerlHandler' stack
perl_cmd_push_handlers: @PerlHandler, 'Apache::Status'
pushing `Apache::Status' into `PerlHandler' handlers
PerlHandler Apache::Status (OK) Limit=no
SetHandler perl-script (OK) Limit=no
perl_section: </Location>
perl_section: </Files>
perl_section: </Location>
perl_section: </Directory>
perl_section: </Directory>
perl_section: </VirtualHost>
.............


At request time, this is what appears in the error_log
`PerlInitHandler' push_handlers() stack is empty
PerlInitHandler handlers returned -1
`PerlPostReadRequestHandler' push_handlers() stack is empty
PerlPostReadRequestHandler handlers returned -1
`PerlTransHandler' push_handlers() stack is empty
PerlTransHandler handlers returned -1
`PerlInitHandler' push_handlers() stack is empty
PerlInitHandler handlers returned -1
`PerlHeaderParserHandler' push_handlers() stack is empty
PerlHeaderParserHandler handlers returned -1
`PerlAccessHandler' push_handlers() stack is empty
PerlAccessHandler handlers returned -1
`PerlTypeHandler' push_handlers() stack is empty
PerlTypeHandler handlers returned -1
`PerlFixupHandler' push_handlers() stack is empty
PerlFixupHandler handlers returned -1
[Wed Feb 14 15:18:38 2001] [error] [client 209.246.133.20] File does not exist: /nis.home/mschout/dev/gkgdrs/gkgweb/html/perl-status-1
`PerlLogHandler' push_handlers() stack is empty
PerlLogHandler handlers returned -1


and running under strace, this is what we see during the request:
write(2, "`PerlInitHandler\' push_handlers("..., 49) = 49
write(2, "PerlInitHandler handlers returne"..., 37) = 37
write(2, "`PerlPostReadRequestHandler\' pus"..., 60) = 60
write(2, "PerlPostReadRequestHandler handl"..., 48) = 48
write(2, "`PerlTransHandler\' push_handlers"..., 50) = 50
write(2, "PerlTransHandler handlers return"..., 38) = 38
stat("/nis.home/mschout/dev/gkgdrs/gkgweb/html/perl-status-1", 0xbffff6dc) = -1 ENOENT (No such file or directory)
stat("/nis.home/mschout/dev/gkgdrs/gkgweb/html", {st_mode=S_IFDIR|S_ISGID|0775, st_size=3072, ...}) = 0
open("/.htaccess", O_RDONLY)            = -1 ENOENT (No such file or directory)
open("/nis.home/.htaccess", O_RDONLY)   = -1 ENOENT (No such file or directory)
open("/nis.home/mschout/.htaccess", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/nis.home/mschout/dev/.htaccess", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/nis.home/mschout/dev/gkgdrs/.htaccess", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/nis.home/mschout/dev/gkgdrs/gkgweb/.htaccess", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/nis.home/mschout/dev/gkgdrs/gkgweb/html/.htaccess", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0664, st_size=194, ...}) = 0
fstat(4, {st_mode=S_IFREG|0664, st_size=194, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40018000
read(4, "#\n# $Id: .htaccess,v 1.13 2000/1"..., 4096) = 194
read(4, "", 4096)                       = 0
close(4)                                = 0
munmap(0x40018000, 4096)                = 0
write(2, "`PerlInitHandler\' push_handlers("..., 49) = 49
write(2, "PerlInitHandler handlers returne"..., 37) = 37
write(2, "`PerlHeaderParserHandler\' push_h"..., 57) = 57
write(2, "PerlHeaderParserHandler handlers"..., 45) = 45
write(2, "`PerlAccessHandler\' push_handler"..., 51) = 51
write(2, "PerlAccessHandler handlers retur"..., 39) = 39
write(2, "`PerlTypeHandler\' push_handlers("..., 49) = 49
write(2, "PerlTypeHandler handlers returne"..., 37) = 37
open("/nis.home/mschout/dev/gkgdrs/gkgweb/html/", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
fstat(4, {st_mode=S_IFDIR|S_ISGID|0775, st_size=3072, ...}) = 0
fcntl(4, F_SETFD, FD_CLOEXEC)           = 0
getdents(4, /* 43 entries */, 3933)     = 836
getdents(4, /* 0 entries */, 3933)      = 0
close(4)                                = 0
write(2, "`PerlFixupHandler\' push_handlers"..., 50) = 50
write(2, "PerlFixupHandler handlers return"..., 38) = 38
time(NULL)                              = 982185592
write(15, "[Wed Feb 14 15:19:52 2001] [erro"..., 135) = 135
alarm(300)                              = 0
alarm(0)                                = 300
alarm(300)                              = 0
alarm(0)                                = 300
write(3, "HTTP/1.1 404 Not Found\r\nDate: We"..., 482) = 482
write(2, "`PerlLogHandler\' push_handlers()"..., 48) = 48
write(2, "PerlLogHandler handlers returned"..., 36) = 36
time(NULL)                              = 982185592
write(20, "209.246.133.20 - - [14/Feb/2001:"..., 142) = 142
....

So it appears to not be matching the requested uri against ^/perl-status-1$ for
some reason.  It seems that this should be valid.  Am I missing something
obvious here?  This has be about to pull my own hair out :).

Mike