How to enable/access Apache Server-Status

The Server Status module is built by default in Apache and can be enabled in the /etc/httpd.conf file by adding the lines:

<Location "/server-status">
    SetHandler server-status
</Location>

You can add some rules to allow access to the status page from one IP only. Example:

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

A related option here is the ExtendedStaus directive.

This option tracks additional data per worker about the currently executing request and creates a utilization summary. You can see these variables during runtime by configuring mod_status. Note that other modules may rely on this scoreboard.

Apache help

Starting from Apache 2.3.6, the loading of the mod_status module will change the directive ExtendedStatus to On.

apache server status
Apache Web Server Status page

In cPanel the lines from the /etc/httpd.conf file are:

# You can change this by using WHM, and updating the 'Tweak Settings' -> 'System' -> 'Allow server-info' option.
<IfModule status_module>
    # This is used by the WHM 'Apache Status' application
    <Location /whm-server-status>
        SetHandler server-status
        Order deny,allow
        Deny from all
        Allow from 127.0.0.1 ::1
        <IfModule security2_module>
            SecRuleEngine Off
        </IfModule>
    </Location>

</IfModule>

You can see that the status page will be available at localhost/whm-server-status/ but only for local clients (127.0.0.1 / ::1).


In DirectAdmin, the file in question is /etc/httpd/conf/extra/httpd-info.conf. The lines are:

# Allow server status reports generated by mod_status,
# with the URL of http://servername/server-status
# Change the ".example.com" to match your domain to enable.

<Location /server-status>
    SetHandler server-status
    Require host .example.com
    Require ip 127
</Location>

Here, the URL will be localhost/server-status. You can configure a host or an IP that can access the status page.

Resources:
Apache Module mod_status
ExtentedStatus Directive
DA Apache Troubleshooting

Leave a Reply