I've got a working mod_perl installation on Ubuntu 10.O4. I've done the following things to get it working.

First i've created a file "/etc/apache2/site-available/yoursite" with following configuration:"

<VirtualHost *:80> ServerName yoursite ServerAdmin webmaster@localhost DocumentRoot /var/www/yoursite PerlModule ModPerl::Registry <Location /> SetHandler perl-script PerlResponseHandler ModPerl::Registry Options +ExecCGI </Location> ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, c +rit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined </VirtualHost>

Note that i create a virtual host with a given name. To make sure that the site is visible, add a following line in your "/etc/hosts":

127.0.0.1 yoursite.localdomain yoursite

Now create the directory "/var/www/yoursite", make sure it is readable by user "www-data", and create a file "test.pl" with following content:

use Apache2::RequestUtil; my $r = Apache2::RequestUtil->request; $r->content_type("text/html"); $r->print("mod_perl rules!");

Note i've removed the "$r->send_http_header" line. It is not a valid method anymore under mod_perl2.

Restart your apache server.

This should give, when going to "http://yoursite/perl.pl", the text "mod_perl rules!".

Hope this helps.

Kind regards

Martell


In reply to Re: How to configure mod_perl? by martell
in thread How to configure mod_perl? by rifat

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.