mod perl2 ubuntu

ashley maher ashley.maher at didymodesigns.com.au
Sat Aug 27 03:30:35 UTC 2005


G'day,

I loaded the mod perl2 package into Ubuntu.

Using the examples from perl.apache.org I tested the installation.
(slightly modded for directory differences) 

This section tested regestery scripts.

Alias /perl/ /var/www/perl/

<Location /perl/>
      SetHandler perl-script
      PerlResponseHandler ModPerl::Registry
      PerlOptions +ParseHeaders
      Options +ExecCGI
</Location>


The registery scripts worked well.

The handler modules test failed misserably.

The examples from perl.apache.org that I modded are below. Allong with
the tail of /var/log/apache2/error.log.

#!/usr/bin/perl
print "Content-type: text/plain\n\n";
print "mod_perl 2.0 rocks!\n";



#file:MyApache2/Rocks.pm
#----------------------
package MyApache2::Rocks;

use strict;
use warnings;

use Apache2::RequestRec ();
use Apache2::RequestIO ();

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

sub handler {
my $r = shift;
  
$r->content_type('text/plain');
print "mod_perl 2.0 rocks!\n";
  
return Apache2::Const::OK;
}
1;

#file: startup.pl
#----------------
use lib qw(/var/www);
1;

#file: config file for mod perl
# used for the perl handler tests
#--------------------------------

PerlRequire /usr/share/autoschool/bin/startup.pl
<Location /rocks>
SetHandler perl-script
PerlResponseHandler  MyApache2::Rocks
</Location>

#This is the tail of /var/log/apache2/error.log
[Sat Aug 27 12:39:38 2005] [notice] caught SIGTERM, shutting down
[Sat Aug 27 12:39:40 2005] [notice] Apache/2.0.53 (Ubuntu)
mod_perl/1.99_14 Perl/v5.8.4 PHP/4.3.10-10ubuntu4 configured -- resuming
normal operations
[Sat Aug 27 12:39:46 2005] [error] failed to resolve handler
`MyApache2::Rocks'
[Sat Aug 27 12:39:46 2005] [error] [client 127.0.0.1] Can't locate
Apache2/RequestRec.pm in @INC (@INC
contains: /usr/lib/perl5/Apache2 /var/www /etc/perl /usr/local/lib/perl/5.8.4 /usr/local/share/perl/5.8.4 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl . /etc/apache2/ /etc/apache2/lib/perl) at /var/www/MyApache2/Rocks.pm line 8.\nBEGIN failed--compilation aborted at /var/www/MyApache2/Rocks.pm line 8.\nCompilation failed in require at (eval 4) line 3.\n


Ideas greatfully received.

Regards,

Ashley





More information about the ubuntu-users mailing list