mod_status IP restrictions
Hi all, I am quite confused about something I expect is rather simple...hope someone can give me a quick bit of advice. Apologies if this has been asked before...
Anyhow, I've just set up mod_status in Apache 2.4, which is running on Server 2008 R2.
In the <location> section of the httpd.conf, if I set "Allow from all", then hostname.com/server-status works a treat, no worries.
If I set "deny all" and "allow" to a specific IP (the server itself), I get 403 forbidden even though I am directly accessing it from that IP. Yes, I am restarting the server each time I edit the .conf file... ;-)
I've tried restricting it in various ways, copying many examples found online, but server-status either works for everyone, or works for no one.
Wondering what might be wrong... I'm a bit stumped, and becoming frustrated.
Here is what I want...
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from 192.168.1.111
Allow from 192.168.1.112
Allow from 192.168.1.118
</Location>
Any ideas?
At the moment, all the specific "allows" are commented out and "allow from all" is active, and works...
Thanks folks...
Posted Aug 14, 2016, 11:49 AM UTC · edited
Ive always used the "allow,deny" order, only used "allow from", and let it default to deny when it doesnt match any of the allow directives.
Thanks mate. I'm a newb when it comes to Apache configuration.
I did a bit more digging, realised I hadn't enabled the httpd-info.conf, and in the "allow" section, I replaced what I had with "Allow from 192.168.1.0/24" and we're good to go... tested from outside my network and it's blocked as need.
Good for now, but it looks like I have my work cut out for me, familiarising myself with the allow/deny authorisation model of Apache...
ta