Click here to get back home

mod_perl is in .conf file, but how to verify it's loaded?

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
mod_perl is in .conf file, but how to verify it's loaded? bennett 02-23-2007
Posted by bennett on February 23, 2007, 4:59 pm
Please log in for more thread options


I have installed mod_perl on my CentOS 4 machine. I can tell:

[root@SP4659a ~]# perl -Mmod_perl -le 'print mod_perl->VERSION'
1.9916


I would *assume* that the Web server has loaded it, because I
have the file:
/etc/httpd/conf.d/perl.conf
and my main /etc/httpd/conf/httpd.conf file includes the line:
Include conf.d/*.conf


And I have restarted the server since installing mod_perl, and it
restarted with no errors. (Although I think mod_perl was probably
actually installed before I ran the "yum install mod_perl"
command.)


But I'd like to verify directly, from within a Perl script or from
HTTP headers or something, that the Apache webserver has loaded
mod_perl correctly -- how do I do that?


One source:
http://www.debian-administration.org/articles/216
said that I could telnet to port 80 of the machine and get the "/"
page, and if mod_perl was installed, it would be mentioned in the
http
headers. But I don't see it:


[root@SP4659a ~]# telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
GET / HTTP/1.1
Host: localhost


HTTP/1.1 200 OK
Date: Fri, 23 Feb 2007 21:13:03 GMT
Server: Apache/2.0.52 (CentOS)
Last-Modified: Thu, 11 Jan 2007 00:13:05 GMT
ETag: "908001-65-a4a5a640"
Accept-Ranges: bytes
Content-Length: 101
Connection: close
Content-Type: text/html; charset=UTF-8


<html>
[etc.]


I have also installed a Perl script that prints the values of all
environment variables, and I don't see it there either:
http://www.amazonshield.com/cgi-bin/z1/nph-showall.cgi


How can I verify that it's loaded? Or does this mean it's not
actually loaded properly?


Posted by Juha Laiho on February 25, 2007, 1:07 pm
Please log in for more thread options


bennett@peacefire.org said:
>I have installed mod_perl on my CentOS 4 machine.
...
>I would *assume* that the Web server has loaded it
...
>And I have restarted the server since installing mod_perl, and it
>restarted with no errors. (Although I think mod_perl was probably
>actually installed before I ran the "yum install mod_perl"
>command.)
...
>But I'd like to verify directly, from within a Perl script or from
>HTTP headers or something, that the Apache webserver has loaded
>mod_perl correctly -- how do I do that?

You create and activate some simple mod_perl functionality, such as
a script to be parsed by mod_perl.

>One source:
>http://www.debian-administration.org/articles/216
>said that I could telnet to port 80 of the machine and get the "/"
>page, and if mod_perl was installed, it would be mentioned in the
>http
>headers. But I don't see it:

... most possibly because current web servers tend to disable that
kinds of information leaks. There's a directive in httpd.conf limiting
the amount of server information disclosed in response headers.

>I have also installed a Perl script that prints the values of all
>environment variables, and I don't see it there either:
>http://www.amazonshield.com/cgi-bin/z1/nph-showall.cgi

I'd guess this (/cgi-bin/ directory) is set to be executed using the
CGI mechanism, not via mod_perl. Thus the scripts are given a pure
CGI environment, not something spiced up with mod_perl.

>How can I verify that it's loaded? Or does this mean it's not
>actually loaded properly?

Either by creating something parsed by mod_perl, or by turning on
mod_info for your server, and checking the loaded modules from there.
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)

Similar ThreadsPosted
Perl code to verify web site (SSL) certificate August 18, 2004, 8:56 pm
Perl code to verify web site (SSL) certificate August 18, 2004, 8:57 pm
CGI.pm and ModPerl::Registry December 21, 2007, 11:20 pm
modperl and apache handlers December 28, 2004, 5:38 am
CPAN conflict issue - CGI.pm vs ModPerl::Registry September 25, 2006, 12:42 pm
Q: Digest::SHA1 module cannot be loaded February 8, 2005, 5:50 pm
retrieving a constant from a dynamically loaded module October 26, 2005, 3:29 am
http, library loaded, httpS library can't be found November 8, 2004, 9:51 am
install HTML::Template - Problem reading cache file / Bad file number July 24, 2004, 7:55 pm
Reading contents of an excel file from a test file May 15, 2007, 2:49 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap