For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > May 2004 > Q: mod_perl 1.99 and /perl-status/ problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Q: mod_perl 1.99 and /perl-status/ problem
Randy Lawrence

2004-05-24, 6:32 pm

SETUP:

Centos 3.1 (distro based on RedHat AS3)
Perl 5.8.0
mod_perl 1.99_09
Apache 2.0.46

PROBLEM:

The example /perl-status mapped to Apache::Status only works for httpd
processes that have previously handled at least one other perl script
(example shown below). Otherwise, it errors with method "print" not
found in Status.pm line 144.


WORKAROUND (CHEESY):

Cause all httpd processes to compile at least one mod_perl script before
they handle a /perl-status request. Currently, I just hit "RELOAD" a
bunch of times on the /perl/HelloWorld.pl URL.

If I just hit HelloWorld.pl only once, then only that particular httpd
process will handle /perl-status correctly, other httpd processes return
error on Apache::Status.pm line 144.


QUESTION:

This doesn't happen on my production server (RedHat AS3)--what did I do
wrong? Seems the apache configuration is identical between production
server and dev server--what do I need to check to fix this?


DETAILS:

HelloWorld.pl script that causes httpd process to correctly handle
/perl-status in subsequent requests:

print "Content-type: text/plain\n\n";
print "Hello world\n";

perl.conf file loaded/included by httpd.conf

LoadModule perl_module modules/mod_perl.so
PerlWarn On
PerlTaintCheck On

Alias /perl /var/www/perl
<Directory /var/www/perl>
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options +ExecCGI
</Directory>

<Location /perl-status>
SetHandler perl-script
PerlResponseHandler Apache::Status
Order deny,allow
Deny from all
Allow from 192.168.0 127.0.0.1
</Location>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com