i have the same setup as you (Apache2 with mod_perl2 on Ubuntu 6.10) and have no problem running Perl scripts under mod_perl2.

one way to get started is by running Perl scripts using ModPerl::Registry as described in the mod_perl2 documentation. you could take these steps:

  1. (in one terminal) keep an eye on what Apache2 is doing:

    sudo tail -f /var/log/apache2/error.log
  2. (in another terminal) make sure mod_perl2 is loaded by Apache2:

    sudo a2enmod perl /etc/init.d/apache2 restart
  3. create the test directory /var/www/mp2-test and place a simple Perl CGI script there with this content (your posted test CGI script is incorrect and will produce a warning, because it doesn't print a content line):

    #!/usr/bin/perl print "Content-type: text/plain\n\n"; print "mod_perl 2.0 rocks!\n";
  4. configure Apache2 to run scripts in /var/www/mp2-test with mod_perl2:

    PerlModule ModPerl::Registry <Location "/mp2-test/"> SetHandler perl-script PerlHandler ModPerl::Registry Options +ExecCGI </Location>

also check out the freely available ModPerl Book that covers mod_perl2. and if your still having troubles post back.

. :)))))

In reply to Re: mod-perl configuration under Apache2 by asz
in thread mod-perl configuration under Apache2 by Bruce32903

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.