Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to properly enable mod_status on an apache server?

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

like image 588
Willy Avatar asked Sep 29 '13 21:09

Willy


2 Answers

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.

like image 74
Welsh Avatar answered Oct 07 '22 16:10

Welsh


Apache 2.4 do not appear to like a space in the Order directive.

Order Allow, Deny only works as

Order Allow,Deny

like image 23
Nomad77 Avatar answered Oct 07 '22 16:10

Nomad77