The following has not been verified by me and may be added to an existing vhost directive file
PerlModule ModPerl::Registry <Files ~ "\.(pl|cgi)$"> SetHandler perl-script PerlResponseHandler ModPerl::Registry Options +ExecCGI PerlSendHeader On </Files>
and then any .pl or .cgi files in any of your directories will be executed.
As I usually do for security reasons:
PerlModule ModPerl::Registry <Directory /opt/myawesomescripts/> SetHandler perl-script PerlResponseHandler ModPerl::Registry PerlOptions +ParseHeaders Options +ExecCGI AllowOverride None </Directory>
The previous method will strip Directory Browsing, if you need it, you should do something like this:
PerlModule ModPerl::Registry <Directory /var/www/> Options FollowSymLinks MultiViews ExecCGI Indexes AddHandler perl-script .cgi .pl PerlResponseHandler ModPerl::Registry AllowOverride None Order allow,deny allow from all </Directory>
AndrewPK
source share