<IfDefine PERL>
LoadModule perl_module modules/mod_perl.so

#PerlTrace all
PerlRequire "/etc/apache2/modules.d/apache2-mod_perl-startup.pl"
PerlModule ModPerl::Registry

# Provide two aliases to the same cgi-bin directory, to see the effects of the
# 2 different mod_perl modes for Apache2::Registry Mode
Alias /perl/ /var/www/localhost/perl/
# for Apache2::Perlrun Mode
Alias /cgi-perl/ /var/www/localhost/perl/

<Location /perl-status>
	SetHandler perl-script
	PerlResponseHandler Apache2::Status
	Require host localhost
</Location>

<Directory /home/*/public_html/perl>
	SetHandler perl-script
	PerlResponseHandler ModPerl::PerlRun
	PerlOptions +ParseHeaders

	# Clear all existing options and only permit cgi.
	Options ExecCGI
</Directory>

# set Apache::Registry Mode for /perl Alias
<Location /perl/*.pl>
	SetHandler perl-script
	PerlResponseHandler ModPerl::Registry
	PerlSendHeader On

	# Clear all existing options and only permit cgi.
	Options ExecCGI

	Require all granted
</Location>

# set Apache::PerlRun Mode for /cgi-perl Alias
<Location /cgi-perl/*.pl>
	SetHandler perl-script
	PerlResponseHandler ModPerl::PerlRun
	PerlSendHeader On

	# Clear all existing options and only permit cgi.
	Options ExecCGI

	Require all granted
</Location>
</IfDefine>

# vim: ts=4 filetype=apache
