Articles

How to Enable the Apache Server Status Page

The Apache status module, commonly known as mod_status or server-status, provides information about the requests Apache is serving and has recently served. This information includes

  • the number of workers serving requests;
  • the number of idle workers'
  • the status of each worker, the number of requests that worker has performed, and the total number of bytes served by the worker;
  • the total number of accesses and the number of bytes served;
  • the time the server was last started/restarted and the time it has been running for;
  • averages giving the number of requests per second, the number of bytes served per second, and the average number of bytes per request;
  • the current CPU usage by each worker and in total by all workers; and
  • the current hosts and requests being processed.

Enable server-status for an App

To enable the Apache status page, edit the .htaccess file of the app you want this page to be available on. Note that the status page will show information for all apps on a server.

Add the following lines to the top of your app's .htaccess file:

<Files server-status>
SetHandler server-status
# Use "Require ip" lines to restrict access from only certain IP addresses.
# Require ip 127.0.0.1
# Require ip 1.2.3.4
</Files>

You can then see the status page at:

http://YOUR_DOMAIN/server-status

If you are requesting the status page from a script, you can add ?auto to the end of the URL to retrieve the contents in a format that is easier for your scripts to read.

http://YOUR_DOMAIN/server-status?auto