Pages

Thursday, August 7, 2014

Apache Server Status – mod_status module

In a production environment we will be maintaining many number of Apache instances for processing the user requests. It is hard for a administrator to manage these multiple instances of the apache servers.

Apache provide various numbers of modules for various operations. There is one module called mod_status.so which provides out-of-the-box functionality for monitoring the performance of Apache installations. In this article we will see how we can configure the mod_status module and how we can read the status.

1. Make sure the mod_status module is loaded like
LoadModule status_module modules/mod_status.so

2.Configure Apache configuration like

ExtendedStatus On

<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from localhost 172.16.101.228
</Location>

3. Now we can access http://localhost/server-status which will give various information regarding the Apache instances like,

We can also use http://localhost/server-status?refresh=15 which will make the status page refresh for every 15 seconds.

The header contains basic information about the Apache installation like

Server Version: Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3
Server Built: Apr 9 2011 08:58:28


There is a status summary containing basic status information like,

Current Time: Thursday, 07-Aug-2014 17:15:35 IST
Restart Time: Thursday, 07-Aug-2014 16:57:40 IST
Parent Server Generation: 0
Server uptime: 17 minutes 55 seconds
Total accesses: 10 - Total Traffic: 34 kB
CPU Usage: u0 s0 cu0 cs0
.0093 requests/sec - 32 B/second - 3481 B/request
1 requests currently being processed, 7 idle workers

__W_____........................................................
.......................................................................
.......................................................................
.......................................................................


The bottom of the status page contains information about current requests like,

Srv   PID   Acc     M      CPU   SS Req Conn  Child  Slot Client VHost Request
0-0 19126 0/2/2 _ 0.00 45     0   0.0  0.01   0.01 localhost localhost.localdomain GET /server-status?refresh=15 HTTP/1.1

The mod_status module helps us to obtain various information about the Apache Installations.

More to Come, happy Learning :-)

No comments :

Post a Comment