So how do you install and configure mod_status? I
make the assumption here that you built and installed Apache from source.
If you're not familiar with building Apache, may I suggest you read my earlier
HTTP Wrangler column,
Getting, Installing, and Running Apache.
First, move into your Apache source directory.
?
% cd /usr/local/src/apache_1.3.x
Thankfully Apache's configure script creates a cache
file, config.status, saving us the bother of completely
reconfiguring our Apache build from scratch. All we need to do is run
config.status, supplying the one argument necessary
to add mod_status.
If you've not already done so, now would be the time to become root.
?
# ./config.status --enable-module=status
Configuring for Apache, Version 1.3.11
...
Creating Makefile
Creating Configuration.apaci in src
Creating Makefile in src
+ configured for Linux platform
+ setting C compiler to gcc
+ setting C pre-processor to gcc -E
+ checking for system header files
+ adding selected modules
+ checking sizeof various data types
+ doing sanity check on compiler and options
...
Creating Makefile in src/modules/standard
Note: Apache's configure script automagically updates
config.status to include mod_status; next time you
configure you will not need to enable mod_status again.
Now that we've reconfigured Apache, let's rebuild.
?
# make
Your screen should look something like:
?
# make
===> src
make[1]: Entering directory `src/httpd/apache_1.3.11'
make[2]: Entering directory `src/httpd/apache_1.3.11/src'
===> src/regex
...
[several unsightly lines later]
...
gcc -DLINUX=2 -DUSE_HSREGEX -DUSE_EXPAT -I../lib/expat-lite
-DNO_DL_NEEDED `../apaci` -o ab -L../os/unix -L../ap ab.o
-lap -los -lm -lcrypt
make[2]: Leaving directory `src/httpd/apache_1.3.11/src/support'
<=== src/support
make[1]: Leaving directory `src/httpd/apache_1.3.11'
<=== src
#
Finally, you're ready to install your newly freshly built Apache.
?
# make install
(While not strictly necessary -- reinstalling should only overwrite files
that probably haven't changed since your last install -- I always advise
backing up your Apache directory.)
Configuration
Mod_status is easy to configure; in fact the directives already exist
in your httpd.conf file and simply need to be uncommented
and edited slightly.
If you're not familiar with Apache configuration, may I suggest you read my
earlier HTTP Wrangler column,
An Amble Through Apache Configuration.
?
# cd /usr/local/apache/conf
(or wherever your Apache installation's configuration files are located)
Open your httpd.conf file in the text editor of your choice and search for
the following set of configuration directives:
?
# Allow server status reports, with the URL of http://servername/server-status
# Change the ".your_domain.com" to match your domain to enable.
#
#
# SetHandler server-status
# Order deny,allow
# Deny from all
# Allow from .your_domain.com
#
Uncomment everything from <Location /server-status> to
</Location> by removing the # characters
from the beginning of each line.
It's wise to protect your server-status output from prying eyes. The easiest way
to do this is to restrict its access to one computer or domain. Change the
.your_domain.com to the name of a computer or domain you wish to
allow a peek at server-status. For example, if you're the webmaven for your
server, you may want to allow only your computer, mycomputer.mydomain.org
access, your server-status configuration would look something like:
?
# Allow server status reports, with the URL of http://servername/server-status
# Change the ".your_domain.com" to match your domain to enable.
#
SetHandler server-status
Order deny,allow
Deny from all
Allow from mycomputer.mydomain.org