mod_perl on solaris 11

Setting up mod_perl on solaris 11 using the system-provided binaries for apache 2.2 and mod_perl

Install mod_perl binaries:

**# pkg install pkg:/web/server/apache-22/module/apache-perl**
This will install /etc/apache2/2.2/conf.d/perl.conf which loads the mod_perl.so file into apache on apache restart.

Now we configure handlers so that perl scripts will be run under mod_perl -- here's the last few lines of my /etc/apache2/2.2/httpd.conf

<FilesMatch .pl$>
      SetHandler perl-script
      PerlResponseHandler ModPerl::Registry
      PerlOptions +ParseHeaders
      Options ExecCGI
</FilesMatch>

Lastly, restart apache:

**# svcadm restart apache22**

And here's a test script:

**# cat /var/apache2/2.2/htdocs/hello.pl ** #!/usr/bin/perl print "Content-type: text/plain\n\n"; print "mod_perl 2.0 rocks!\n";