11.3. Server Status

For this exercise, the httpd.conf in ... /site.status file should look like this:

User webuser
Group webgroup
ServerName www.butterthlies.com
DocumentRoot /usr/www/site.status/htdocs

<Location /status>
order deny, allow
allow from 192.168.123.1
deny from all
SetHandler server-status
</Location>

<Location /info>
order deny, allow
allow from 192.168.123.1
deny from all
SetHandler server-status
SetHandler server-info
</Location>

The allow from directive keeps our laundry private.

Remember the way order works: the last entry has the last word. Notice also the use of SetHandler , which sets a handler for all requests to a directory, instead of AddHandler, which specifies a handler for particular file extensions. If you then access www.butterthlies.com/status, you get this response:

Apache Server Status for www.butterthlies.com Server Version: Apache/1.3.1 (Unix) Server Built: Sep 15 1998 15:09:34 Current Time: Tuesday, 13-Oct-1998 08:16:08 Restart Time: Tuesday, 13-Oct-1998 08:15:13 Server uptime: 55 seconds Total accesses: 1 - Total Traffic: 0 kB CPU Usage: u0 s0 cu0 cs0 .0182 requests/sec - 0 B/second - 0 B/request 1 requests currently being processed, 5 idle servers _W____.......................................................... ................................................................ ................................................................ ................................................................ Scoreboard Key: "_" Waiting for ...

Get Apache: The Definitive Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.