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:
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 startup file (or in httpd.conf, or wherever you prefer to put it):
# startup.pl
use Apache::Status ();
use Apache::Registry ();
use Apache::DBI ();
If you don't put Apache::Status
before Apache::DBI
, you won't get Apache::DBI
's menu entry in status.
For more about Apache::DBI
see Persistent DB Connections.
Usage
Assuming that your mod_perl server listens on port 81, fetch http://www.myserver.com:81/perl-status
You should see a couple of lines of information about your software versions followed by a number of hypertext links, something like the following:
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
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
Some of the links give you further menus, from which you can continue to peek deeper into the server internals. You can see the values of all the global variables in your packages, cached scripts and modules, and much more. Just click around...
Let's follow, for example, the link to PerlRequire
'd files. We see something like this:
PerlRequire Location
/home/perl/apache-startup.pl /home/perl/apache-startup.pl
The Compiled Registry Scripts Section Seems To Be Empty
Sometimes when you fetch /perl-status and follow the link to Compiled Registry Scripts you see no listing of scripts at all. This is usually the correct behaviour: Apache::Status
shows the registry scripts compiled in the httpd child which is serving your request for /perl-status. If you happen to ask for the status information from a child which has not yet compiled the script that you are looking for, then /perl-status will just show you the main menu. See also the section Sometimes it Works, Sometimes it Doesn't"