How to properly enable mod_status on an apache server?

Willy picture Willy · Sep 29, 2013 · Viewed 30.8k times · Source

I have been searching everywhere looking for how to properly enable mod_status and nothing has worked. My server is called "willserver.main.ca". I am running the server on a windows virtual machine. I tried adding this to HTTPD config file:

<location /server-status>
SetHandler server-status

Order Deny,Allow
Deny from all
Allow from main.ca

</location>

Any tips or help? I don't know if I am supposed to uncomment something or if I am just trying the wrong syntax over and over

Answer

Welsh picture Welsh · Sep 30, 2013

Ok, first confirm that you have a LoadModule that looks similar to this:

LoadModule status_module modules/mod_status.so

If that isn't there, then you'll need to download and add it.

If it is there then try this:

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

See if you can then hit http://www.my-domain.com/server-status

If you can then switch it to:

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

Where 192.168.1.100 is your internal IP if accessing internally or your external IP. This will restrict it so not just anyone can access it. You can then add multiple Allow from for each IP / IP range that requires access.