Mod Perl Icon Mod Perl Icon mod_perl Status. Peeking into the Server's Perl Innards


[ Prev | Main Page | Next ]

Table of Contents:


The Writing Apache Modules with Perl and C book can be purchased online from O'Reilly and Amazon.com.
Your corrections of either technical or grammatical errors are very welcome. You are encouraged to help me to improve this guide. If you have something to contribute please send it directly to me.

[TOC]


Watching the server

This is a very useful feature. You can watch what happens to the Perl parts of the server. Here are the instructions for configuring and using this feature:

[TOC]


Configuration

Add this to http.conf:

  <Location /perl-status>
    SetHandler perl-script
    PerlHandler Apache::Status
    order deny,allow
    #deny from all
    #allow from 
  </Location>

If you are going to use Apache::Status it's important to put it as the first module in the start-up file, or in the httpd.conf:

  # startup.pl
  use Apache::Registry ();
  use Apache::Status ();
  use Apache::DBI ();

If you don't put Apache::Status before Apache::DBI, you wouldn't get Apache::DBI's menu entry in status.

For more about Apache::DBI see Persistent DB Connections.

[TOC]


Usage

Assuming that your mod_perl server listens on port 81, fetch http://www.myserver.com:81/perl-status

  Embedded Perl version 5.00502 for Apache/1.3.2 (Unix) mod_perl/1.16 
  process 187138, running since Thu Nov 19 09:50:33 1998

Below all sections should be links:

  Signal Handlers
  Enabled mod_perl Hooks
  PerlRequire'd Files
  Environment
  Perl Section Configuration
  Loaded Modules
  Perl Configuration
  ISA Tree
  Inheritance Tree
  Compiled Registry Scripts
  Symbol Table Dump

Let's follow, for example, PerlRequire'd Files. We see:

  PerlRequire                   Location
  /home/perl/apache-startup.pl  /home/perl/apache-startup.pl

From some menus you can continue deeper to peek into the internals of the server, to see the values of the global variables in the packages, to the cached scripts and modules, and much more. Just click around...

[TOC]


Compiled Registry Scripts section seems to be empty.

Sometimes when you fetch /perl-status and follow the Compiled Registry Scripts you see no listing of scripts at all. This is absolutely correct: Apache::Status shows the registry scripts compiled in the httpd child which is serving your request for /perl-status. If a child has not compiled yet the script you are asking for, /perl-status will just show you the main menu.

[TOC]


The Writing Apache Modules with Perl and C book can be purchased online from O'Reilly and Amazon.com.
Your corrections of either technical or grammatical errors are very welcome. You are encouraged to help me to improve this guide. If you have something to contribute please send it directly to me.
[ Prev | Main Page | Next ]

Written by Stas Bekman.
Last Modified at 07/29/1999
Mod Perl Icon Use of the Camel for Perl is
a trademark of O'Reilly & Associates,
and is used by permission.