Enable mod_perl on Debian, Ubuntu, & Other Linuxes.

To enable mod_perl with Apache2 on Debian & Ubuntu for all directories served up by Apache2, including user directories such as ~/public_html, add the following lines to /etc/apache2/sites-available/default

# enable mod_perl
    <Files ~ ".(pl|cgi)$">
           SetHandler perl-script
           PerlResponseHandler ModPerl::Registry
           Options +ExecCGI
           PerlSendHeader On
    </Files>

In a real production environment you probably don’t want to enable this for all directories that Apache2 serves up, but only from those directories you expect to run perl in.

Thanks to this thread on the Ubuntu Forums for the info.

Titled updated as per Ozkar’s suggestion.

4 thoughts on “Enable mod_perl on Debian, Ubuntu, & Other Linuxes.”

  1. this was really helpfull man, but you need to changue the tittle since this works with every apache.

    im sing archlinux it worked.

  2. Hi Ozkar,

    Glad you found it useful, and good to know it work on other Linuxes too. I’ll update the title! 🙂

    Thanks
    Mick

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.