I was able to get it to work using the same Ubuntu 9.04 (jaunty) configuration, using the apache2-mpm-prefork model. (Hooray for virtual machines!)

I added the snippet you provided to /etc/apache2/httpd.conf, which is ok since that file is included by /etc/apache2/apache2.conf. I fixed the one typo, changing "PerlOptions _ParseHeaders" to "PerlOptions +ParseHeaders".

Then I put the following "Hello World" program in the /var/www/perl directory, named hello.pl. I was surprised that I did not have to make it executable.

#!/usr/bin/perl print "Content-type: text/html\r\n\r\n"; print "<HTML>\n"; print "<HEAD><TITLE>Hello World!</TITLE></HEAD>\n"; print "<BODY>\n"; print "<H2>Hello World!</H2>\n"; print "</BODY>\n"; print "</HTML>\n"; exit (0);

And after stopping/starting the server, I got the expected output. I did do a full stop then start on the server. A restart will warn about the typo but not stop the server from executing. Perhaps this is your problem.

I didn't do anything special with permissions:

root@jackalope 680# ls -ld /var /var/www drwxr-xr-x 15 root root 4096 Dec 12 09:11 /var drwxr-xr-x 3 root root 4096 Dec 12 09:41 /var/www root@jackalope 681# ls -lRA /var/www /var/www: total 8 -rw-r--r-- 1 root root 45 Dec 12 09:11 index.html drwxr-xr-x 2 root root 4096 Dec 12 09:58 perl /var/www/perl: total 4 -rw-r--r-- 1 root root 232 Dec 12 09:58 hello.pl

In reply to Re: mod_perl configuration of Apache2 by gmargo
in thread mod_perl configuration of 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.