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 Responses to “Enable mod_perl on Debian, Ubuntu, & Other Linuxes.”  

  1. 1 ozkar

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

    im sing archlinux it worked.

  2. 2 Mick

    Hi Ozkar,

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

    Thanks
    Mick

  3. 3 Simon

    Thank you, you are the man!
    I am a newbie to programming in Perl.
    I’ve found your tip is helpful.

  4. 4 Mick

    Thanks Simon.

Leave a Reply



Dark Sky Over KenmoreSunset over the Charles riverMisty day in BostonSunset over Donegal Bay.Er ...Bye bye Ireland

Recently Played Tunes

  • Rufus Wainwright Rufus Wainwright
    13 May 2012
    12:24 am

  • Sting Sting
    13 May 2012
    12:13 am

  • Sasha & John Digweed Sasha & John Digweed
    28 Apr 2012
    7:46 pm

Google Search

Google

Categories