Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

I have Apache server on Linux with mod_so support. I have used perl as CGI, but I wanted to build mod_perl too. So it seems that everything works fine (as far as installation goes) but I am not sure if it is serving things via mod_perl or via cgi... In other words, how do I check if mod_perl is really working?

Replies are listed 'Best First'.
Re: mod_perl: is it running?
by valdez (Monsignor) on Sep 17, 2002 at 09:51 UTC

    Check the value of GATEWAY_INTERFACE inside %ENV, it should be CGI-Perl; if you need a little example, take a look at the code of CGI.pm and then,please, read the online manuals at mod_perl site, you will find everything you need and even more ;-)

    Ciao, Valerio

Re: mod_perl: is it running?
by adrianh (Chancellor) on Sep 17, 2002 at 09:57 UTC
Re: mod_perl: is it running?
by astaines (Curate) on Sep 17, 2002 at 12:14 UTC

    Another source of useful information - There is a perl-status switch, set this in httpd.conf, and you'll have access to lots of useful info about mod_perl and it's workings.

    --
    Anthony Staines
Re: mod_perl: is it running?
by blm (Hermit) on Sep 17, 2002 at 12:34 UTC
    Or remotely...
    telnet 127.0.0.1 80 HEAD / HTTP/1.1
    (you should substitute an the ip address of the machine in interest for 127.0.0.1 in this example) The should reply something like
    HTTP/1.1 400 Bad Request Date: Tue, 17 Sep 2002 23:32:19 GMT Server: Apache/1.3.26 (Unix) Debian GNU/Linux mod_gzip/1.3.19.1a mod_p +erl/1.27 DAV/1.0.3 Connection: close Content-Type: text/html; charset=iso-8859-1 Connection to host lost.
    Note the presence of something like mod_perl/1.27 says that mod_perl v1.27 is running in Apache.
Re: mod_perl: is it running?
by vek (Prior) on Sep 17, 2002 at 12:29 UTC
    You can check the Apache error_log, look for the following line (versions of Apache/mod_perl will probably vary):
    [Mon Sep 17 05:29:13 2002] [notice] Apache/1.3.26 (Unix) mod_perl/1.27 + configured -- resuming normal operations
    -- vek --

      Just like blm's method and PixelRat's one, this indicator is only helpful in finding out whether Apache has mod_perl support at all. It does nothing to verify whether a specific script is served by mod_perl or runs under mod_cgi.

      Makeshifts last the longest.

Re: mod_perl: is it running?
by PixelRat (Sexton) on Sep 17, 2002 at 12:44 UTC
    use /apachedirectory/bin/httpd -l to see which your compiled-in modules are.

    don't forget to add an alias to you httpd.conf