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



Sunset over Donegal Bay.Er ...Bye bye IrelandRain DropsDome at Boston University and ExplosionRainbow over Mountcharles

Recently Played Tunes

  • George Benson George Benson
    3 Feb 2012
    1:07 am

  • Johnny Marr + the Healers Johnny Marr + the Healers
    28 Jan 2012
    7:02 pm

  • The Waterboys The Waterboys
    28 Jan 2012
    6:59 pm

Google Search

Google

Categories