perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Petry Roman, IT" <>
Subject MP1 -> MP2 migration Problems.
Date Wed, 13 Feb 2008 14:09:44 GMT
Hello @all,

we are just transfering our Intranet Server which used Apache 1.3 and mod_perl1 from SLES8
to SLES10 wiht Apache2 and mod_perl2.

The switch has to go quick and we can´t redesign all of our old mp1 programs to mp2, so we
try to use the compat module. But I have no luck with it. 
I tested my config with SELS10, Opensuse 10.3 and Ubuntu but i hit everytime the same problem.
I searched the Mail Archvie and the Documentation, but no luck.

I have the following test script.Very simple.
my $r = Apache->request();
$r->print("mod_perl rules!\n");

apache2 config looks like this. 

ScriptAlias /perl/ /usr/lib/cgi-bin/
    <Location /perl/>
        # mod_perl mode
        SetHandler perl-script
        PerlResponseHandler ModPerl::Registry
        PerlOptions +ParseHeaders
        Options +ExecCGI


root@lamp:/etc/apache2/conf.d# cat perl.conf
PerlRequire "/etc/apache2/"

and looks like this

root@lamp:/etc/apache2# cat
# This file is a placeholder; you can safely ignore or delete it.
print "startup perl dh";
use lib '/usr/lib/perl5/';

  # enable if the mod_perl 1.0 compatibility is needed
  use Apache2::compat ();

I get the following output..

Software error:
Can't locate object method "request" via package "Apache" at /usr/lib/cgi-bin/ line
For help, please send mail to the webmaster (webmaster@localhost), giving this error message
and the time and date of the error. 

It seems, he can´t find the requested methods.. How can i validate that the compat module
is loaded and working ?

if i print the @env array with this perl script i get.
#!/usr/bin/perl -w
use strict;
use CGI::Carp qw(fatalsToBrowser);

print "Content-type: text/html\n\n";
print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">', "\n";
print "<html><head><title>env array</title></head><body>\n";
print "<h1>Umgebungsvariablen:</h1>\n";
print "<table border=\"1\">\n";
print "<tr><th align=\"left\" bgcolor=\"#E0E0E0\">varname</th>",
      "<th align=\"left\" bgcolor=\"#E0E0E0\">value</th></tr>\n";
foreach(keys(%ENV)) {
  print "<tr><td><b>$_</b></td><td><tt>$ENV{$_}</tt></td></tr>\n";
print "<tr><th align=\"left\" bgcolor=\"#E0E0E0\" colspan=\"2\">sum: ",
      scalar keys(%ENV)," envarray</th></tr>\n";
print "</table>\n";
print "</body></html>\n";

here the output...

PATH	/usr/local/bin:/usr/bin:/bin
DOCUMENT_ROOT	/var/www/html
MOD_PERL	mod_perl/2.0.2

so i think mod_perl2 is enabled.

Any help would be great.

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

View raw message