-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 25/06/09 17:51 , Anthony R Fletcher wrote: > I have a mod_perl 2 module, running in Apache 2.2, > > ------------------------------------------------- > package Apache2::NNNN; > > use 5; > use strict; > > use Apache2::Const -compile => qw(DECLINED); > > sub handler > { > return Apache2::Const::DECLINED; > } > > > 1; > ------------------------------------------------- > > and this is enabled in a .htaccess file via > > SetHandler modperl > PerlResponseHandler Apache2::NNNN > > Without the .htaccess config above CGI scripts run fine. With the above > the actual script is returned.
That's because of 'SetHandler modperl' When you use that, you are telling apache definitively that modperl should be used to handle this request. When you return DECLINED, all apache is left with is to fallback to the default handler, and that serves static files. > How do I get Apache to process the .cgi scripts as CGI scripts and not > as just text files? sub handler { my $r = shift; # Whatever logic to decide if it should be a cgi or not... if ($r->filename =~ /\.cgi$/) { $r->handler('cgi-script'); } return Apache2::Const::DECLINED; } -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFKRScRyzKhB4jDpaURAmyGAJ0bKo9u7cdR1/pDnQTCB7QnL1PLWwCdE6Sf BPnLzdh3OekzzvKsR/cXWII= =2RHI -----END PGP SIGNATURE-----