and a httpd.conf block likepackage 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
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.<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 get around this by using a 'Files ~' directive in the httpd.conf to match only my extension, but it seems like declining should work.[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.
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');"
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |