Hi,
I setup a Suse 11.2 server over a year ago and suddenly, after an online software update, my Apache server is broken. It just writes a few lines to the error log and produces no output. Here is the error message:
Global $r object is not available. Set:
PerlOptions +GlobalRequest
in httpd.conf at /usr/lib/perl5/5.10.0/CGI/Carp.pm line 553.
I looked at the Carp.pm line 553:
$r = Apache2::RequestUtil->request;
The online documentation from
http://search.cpan.org/~gozer/mod_pe...equestUtil.pod
says:
# get the global request object (requires PerlOptions +GlobalRequest)
$r = Apache2::RequestUtil->request;
I have +GlobalRequest set in my mod_perl.conf file for location /perl/ which is aliased to /rr/www/cgi-bin/, the physical directory for my Perl scripts:
ScriptAlias /perl/ "/rr/www/cgi-bin/"
<Location /perl/>
# mod_perl mode
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
PerlOptions +GlobalRequest
Options +ExecCGI
</Location>
In the mod_perl-startup.pl script which is PerlRequired in the mod_perl.conf file, it uses the RequestUtil module:
use Apache2::RequestUtil ();
I thought to update apache and mod_perl, but they are both the latest versions in yast. I even rebooted.
Do I have PerlOptions +GlobalRequest in the wrong place? I have not done any system work since setup the server over a year ago except for running yast -> online_update.
Puzzled,
BrianP
vulcan:/etc/apache2/conf.d # uname -a
Linux vulcan 2.6.31.14-0.1-desktop #1 SMP PREEMPT 2010-09-17 11:32:00 +0200 x86_64 x86_64 x86_64 GNU/Linux
vulcan:/etc/apache2/conf.d # rpm -q apache2-mod_perl
apache2-mod_perl-2.0.4-41.5.x86_64
vulcan:/etc/apache2/conf.d # rpm -q apache2
apache2-2.2.13-2.4.1.x86_64
Details of conf files:
vulcan:/etc/apache2/conf.d # cat mod_perl.conf
<Directory "/rr/www/perl-lib">
AllowOverride None
Options None
Order allow,deny
Deny from all
</Directory>
<IfModule mod_perl.c>
PerlRequire "/etc/apache2/mod_perl-startup.pl"
ScriptAlias /perl/ "/rr/www/cgi-bin/"
<Location /perl/>
# mod_perl mode
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
PerlOptions +GlobalRequest
Options +ExecCGI
</Location>
ScriptAlias /cgi-perl/ "/rr/www/cgi-bin/"
<Location /cgi-perl>
# perl cgi mode
SetHandler perl-script
PerlResponseHandler ModPerl::PerlRun
PerlOptions +ParseHeaders
PerlOptions +GlobalRequest
Options +ExecCGI
</Location>
# The /cgi-bin/ ScriptAlias is already set up in httpd.conf
</IfModule>
# vim: ft=apache
From /usr/lib/perl5/5.10.0/CGI/Carp.pm
if ($mod_perl) {
my $r;
if ($ENV{MOD_PERL_API_VERSION} && $ENV{MOD_PERL_API_VERSION} == 2) {
$mod_perl = 2;
require Apache2::RequestRec;
require Apache2::RequestIO;
require Apache2::RequestUtil;
require APR::Pool;
require ModPerl::Util;
require Apache2::Response;
$r = Apache2::RequestUtil->request; << LINE 553 from error log.
}
vulcan:/etc/apache2/conf.d # cat /etc/apache2/mod_perl-startup.pl
# Taken from
http://perl.apache.org/docs/2.0/user...l#Startup_File
if ( ! $ENV{MOD_PERL}) { die "GATEWAY_INTERFACE not Perl!"; }
use lib qw(/srv/www/perl-lib);
# enable if the mod_perl 1.0 compatibility is needed
# use Apache2::compat ();
# preload all mp2 modules
# use ModPerl::MethodLookup;
# ModPerl::MethodLookup:
reload_all_modules();
use ModPerl::Util (); #for CORE::GLOBAL::exit
use Apache2::RequestRec ();
use Apache2::RequestIO ();
use Apache2::RequestUtil ();
use Apache2::ServerRec ();
use Apache2::ServerUtil ();
use Apache2::Connection ();
use Apache2::Log ();
use APR::Table ();
use ModPerl::Registry ();
use Apache2::Const -compile => ':common';
use APR::Const -compile => ':common';
1;