Running mod_perl on El capitan I'm trying to run mod_perl on El capitan.

Process


Following http://blog.n42designs.com/blog/2014/10/23/compiling-mod-perl-for-apache-2-dot-4-on-os-x-10-dot-10-yosemite/ an https://stackoverflow.com/questions/34240610/how-to-install-mod-perl-2-0-10-in-apache-2-4-on-os-x-el-capitan
The correct repository is different for El capitan, so use svn co  https://svn.apache.org/repos/asf/perl/modperl/tags/2_0_9/

2.perl Makefile.PL MP_CCOPTS=-std=gnu89 ; make ; sudo make install I could get /usr/libexec/apache2/mod_perl.so
In /etc/apache2/other directory, I added cgi.conf with the following content. 




LoadModule perl_module libexec/apache2/mod_perl.so
#PerlModule ModPerl::Registry

&lt;Location "/Library/WebServer/Documents/cgi/"&gt;
    SetHandler perl-script
    PerlResponseHandler ModPerl::Registry
    Options ExecCGI
    PerlSendHeader On
    Order allow,deny
    Allow from all
&lt;/Location&gt;


I copied simple perl cgi script in the /Library/WebServer/Documents/cgi/ directory, but instead of execution the perl script, the perl code is shown. 

What might be wrong? 

ADDED

After adding these lines in the conf file:

&lt;Files ~ "\.(pl|cgi)$"&gt;
    SetHandler perl-script
    PerlResponseHandler ModPerl::PerlRun
    Options +ExecCGI
    PerlSendHeader On
&lt;/Files&gt;


I have errors instead:

[perl:error] [pid 26307] [client ::1:60248] failed to resolve handler `ModPerl::PerlRun': Can't locate ModPerl/PerlRun.pm in @INC (you may need to install the ModPerl::PerlRun module) (@INC contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 ...
For Mac OS X, /Library/WebServer/CGI-Executables has already setup, so there should be no configuration. So, just copying echo.pl in the directory, and use the perl script with localhost/cgi-bin/echo.pl. 

To make it work anyway

We need a ModPerl::PerlRun to install the CPAN module before the compilation. 

sudo cpan ModPerl::PerlRun


This also creates and installs the perl_mod.so, but this breaks the apache, so we need to rebuild the module. This is the working configuration.

LoadModule perl_module libexec/apache2/mod_perl.so

&lt;Location "/Library/WebServer/Documents/cgi/"&gt;
    Options ExecCGI
    Order allow,deny
    Allow from all
&lt;/Location&gt;

&lt;Files ~ "\.(pl|cgi)$"&gt;
    SetHandler perl-script
    PerlResponseHandler ModPerl::PerlRun
    Options +ExecCGI
    PerlSendHeader On
&lt;/Files&gt;


Now localhost/cgi/echo.pl is the address to access.