Apache has built in utilities that help’s a administrator to monitor the performance and activity of their web server. The Apache Status is one such tool that allows real time monitoring of Apache connections and resource usage.
The Apache Status provides information that will help in performance monitoring and Apache tuning. The Apache module mod_status is required to enable apache status . Mod_status will provide the following information to the viewer:
- The number of worker serving requests
- The number of idle worker
- The time the server was started/restarted and the time it has been running.
The status module can also be set to an extended mode, which will display additional information like:
- The status of each worker, the number of requests that worker has performed and the total number of bytes served by the worker
- A total number of accesses and byte count served
- The current CPU used in % by each worker and in total by Apache
- The current hosts and requests being processed
Enable status in ApacheBy default mod_status is already installed and enabled in apache on Centos and Redhat Linux, however to access the information, the Apache configuration must be updated to set the handler for the request.
To set the handler, open the Apache config file /etc/httpd/conf/httpd.conf and search for the following block:
#<Location /server-status>
#SetHandler server-status
#Order deny,allow
#Deny from all
#Allow from .example.com
#</Location>
Un-Comment the above lines ::
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Location>
Save the changes and restart the apache service
Enable Extended Status in ApacheOpen the httpd.conf file and search for the line:
#ExtendedStatus On Just uncomment the above line, If not exist add these lines.