I've enabled mod_status for my own use under Apache/2.4.6 in my Windows 10 development box:
<Location /server-status> SetHandler server-status Require host localhost Require host example Require host example.com Require ip 127.0.0.1 </Location>
example.com represent my Windows Active Directory host name.) I'm also using name-based virtual hosts and I have a default host that roughly looks like this:
<VirtualHost *:80> ServerName localhost DocumentRoot "C:/Sites/Default/htdocs" FallBackResource /index.php ErrorLog "logs/localhost-error.log" CustomLog "logs/localhost-access.log" common <Directory "C:/Sites/Default/htdocs"> Require all granted AllowOverride All Options -Indexes </Directory> </VirtualHost>
... and works fine: any host name or IP address that's not explicitly configured displays my PHP-powered Site does not exist error page, including
I can access server info successfully through any of the hosted sites or right though IP address:
localhost as host name triggers a 403 Forbidden status code:
AH01753: access check of 'localhost' to /server-status failed, reason: unable to get the remote host name AH01753: access check of 'example' to /server-status failed, reason: unable to get the remote host name AH01753: access check of 'example.com' to /server-status failed, reason: unable to get the remote host name AH01630: client denied by server configuration: C:/Sites/Default/htdocs/server-status
I've tried removing
localhost from the
ServerName directive of my default vhost but I'm still getting Forbidden.
localhost to be an exception?