Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: How to configure mod_perl?

by martell (Hermit)
on Jun 17, 2011 at 21:48 UTC ( #910265=note: print w/replies, xml ) Need Help??

in reply to How to configure mod_perl?

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": yoursite.localdomain yoursite

Now create the directory "/var/www/yoursite", make sure it is readable by user "www-data", and create a file "" 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/", the text "mod_perl rules!".

Hope this helps.

Kind regards


Replies are listed 'Best First'.
Re^2: How to configure mod_perl?
by aanriot (Sexton) on Jun 18, 2011 at 08:31 UTC
    And as rifat mentionned, be sure to have mod_perl loaded. If the file /etc/apache2/mods-enabled/perl.load does not exist, run a2enmod perl (it's better than a symlink), and reload Apache.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://910265]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (1)
As of 2022-08-09 21:57 GMT
Find Nodes?
    Voting Booth?

    No recent polls found