Here's one for the mod_perl monks...
Basically the problem I've run into is that returning DECLINED from a handler
doesn't completely return you to the 'normal' chain of events in Apache like
it is supposed to (and as the 'Apache Modules' book seems to agree).
If I have a handler that looks like
package myHandler;
use strict;
use Apache;
use Apache::Constants wq(:response);
sub handler {
my $r = shift;
my $uri = $r->uri();
unless ($uri =~ /\.extension$/) {
return DECLINED;
}
# rest of code
and a httpd.conf block like
<Directory "/usr/local/apache/sites/test">
SetHandler perl-script
PerlHandler myHandler
Options Indexes Includes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
I can't also have something like a PHP page in that same directory. PHP will be handled correctly in other directories, but will return the source for the page in this one. Granted I don't use PHP, but I'm trying to make this 'place nice with others'.
Even stranger, if I add in a "ErrorDocument 404 /404.html" directive to that block, and access a page that doesn't exist, the connection just instantly closes.
[root@styx conf]# telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /test/you_are_not_here HTTP/1.0
Connection closed by foreign host.
I can get around this by using a 'Files ~' directive in the httpd.conf to match only my extension, but it seems like declining should work.
According to Writing Apache Modules pg 68. "The handler has decided it doesn't want to handle the request. Apache will act as if the subroutine were never called and either handle the phase internally or pass the request on to another module that has expressed its interest."
What am I missing here?
/\/\averick
perl -l -e "eval pack('h*','072796e6470272f2c5f2c5166756279636b672');"