panic% perl -le 'print join "\n", @INC'
On our machine it reports:
/usr/lib/perl5/5.6.1/i386-linux
/usr/lib/perl5/5.6.1
/usr/lib/perl5/site_perl/5.6.1/i386-linux
/usr/lib/perl5/site_perl/5.6.1
/usr/lib/perl5/site_perl
.
Therefore, on our machine, we might place the files in the directory
/usr/lib/perl5/site_perl/5.6.1/ModPerl. By
default, when you work as root, the files are
created with permissions allowing everybody to read them, so here we
don't have to adjust the file permissions (the
server only needs to be able to read those).
Now add the following snippet to
/usr/local/apache/conf/httpd.conf, to configure
mod_perl to execute the ModPerl::Rules1::handler
subroutine whenever a request to mod_perl_rules1
is made:
PerlModule ModPerl::Rules1
<Location /mod_perl_rules1>
SetHandler perl-script
PerlHandler ModPerl::Rules1
PerlSendHeader On
</Location>
Now issue a request to:
https://localhost/mod_perl_rules1
and, just as with the mod_perl_rules.pl scripts,
the following should be rendered as a response:
mod_perl rules!
Don't forget to include the port number if not using
port 80 (e.g.,
https://localhost:8080/mod_perl_rules1); from now
on, we will assume you know this.
You should see the same response from the server that we saw when
issuing a request for the former mod_perl handler.