Configure Apache to serve PERL pages ( Ubuntu )

I just reinstalled my ubuntu distribution, and have to configure apache to serve perl pages outside of the cgi-bin directory, after a little bit of googling i found the solution.

You have to edit the /etc/apache2/apache2.conf and add to it the following lines.

  2. AddHandler cgi-script .cgi .pl
  3. <Files ~ "\.pl$">
  4. Options +ExecCGI
  5. </Files>
  6. <Files ~ "\.cgi$">
  7. Options +ExecCGI
  8. </Files>

7 thoughts on “Configure Apache to serve PERL pages ( Ubuntu )

  1. raul

    i get

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

  2. Jameson Williams

    Thanks! Two suggestions:

    Perhaps better to follow the Debian convention of separating out in: /etc/apache2/mods-available/perl.conf

    And with an IfModule check:

    AddHandler cgi-script .cgi .pl

    Options +ExecCGI

    Options +ExecCGI

  3. jitesh

    I was trying to run my perl scripts from a long time…
    Browsed a lot…
    Finally, the perfect match.
    Keep blogging.

  4. TAyyeb

    I spent my time to search this, and finally I found it here and it worked. Thanks a lot for this post.

Leave a Reply

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