libapreq2 : cant locate Apache2/Request.pm

Asked by Raphaël Payen

I want to use the Apache2::Request module documented here :
http://httpd.apache.org/apreq/docs/libapreq2/group__apreq__xs__request.html

so i did
$ sudo apt-get install libapreq2
$ sudo apt-get install libapache2-mod-apreq2

I already have a preliminary question here : is the second line mandatory ? (if yes, why is it not a dependance, if not, what's its use ?)

Then, i tried a simple handler :
-----------------------------
package Test;

use Apache2::RequestRec ();
use Apache2::RequestIO ();
use Apache2::Const -compile => qw(OK);
use Apache2::Request;

sub handler {
    my $r = shift;

    $r->content_type('text/plain');
    print "Mod_perl 2.0 handler\n";

    $req = Apache2::Request->new($r);

    return Apache2::Const::OK;
}
1;
-----------------------------

And i got this error message :

[Thu Jul 03 00:05:25 2008] [error] [client 127.0.0.1] failed to resolve handler `Test': Can't locate Apache2/Request.pm in @INC (@INC contains: /var/www/work/test /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl . /etc/apache2) at /var/www/work/test/Test.pm line 9.\nBEGIN failed--compilation aborted at /var/www/work/test/Test.pm line 9.\nCompilation failed in require at (eval 4) line 3.\n

I then did, in /etc/apache2/mods-enabled
$ sudo ln -s ../mods-available/apreq.load apreq.load
then restarted apache2. I had this line in log :
[notice] Apache/2.2.8 (Ubuntu) mod_apreq2-20051231/2.6.0 mod_perl/2.0.3 Perl/v5.8.8 configured -- resuming normal operations

And i tried again, but got the same message (Can't locate Apache2/Request.pm)

I'll just use CGI.pm instead, but if you can help me understand, i'd be grateful.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu libapreq2 Edit question
Assignee:
No assignee Edit question
Solved by:
Raphaël Payen
Solved:
Last query:
Last reply:
Revision history for this message
Raphaël Payen (rafpayen) said :
#1

Now i apt-get installed libapache2-request-perl and it works.

I just should have guessed from the start that this was the good package to install.