How to properly enable mod_status on an apache server?
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.
Apache 2.4 do not appear to like a space in the Order directive.
Order Allow, Deny only works as
Order Allow,Deny
mod_status built into Apache web server to get server status from a web browser. With this module we can easily find out how well the server is performing. All reports are generated in a html format.
Step1. Check if status module is enabled or notapache2ctl -M or ls /etc/apache2/sites-enabled
Step2. If not enabled, enable it by the command,
sudo a2enmod status
step3. Configure access,
Open /etc/apache2/mods-enabled/status.conf and comment the lines,
#<Location /server-status> # SetHandler server-status # Require local #Require ip 192.0.2.0/24 #</Location>
And add the following line,
<Location /server-status> SetHandler server-status Order deny,allow Allow from all </Location>
We can restrict the access of server status for particular IP’s in this configuration by editing ,Allow from our_public_ipaddress instead of Allow from all
Save the status.conf file .
Step4. Restart apache by the command,
/etc/init.d/apache2 restart
Step5. Check the server status page in browser
http://server-ip/server-status
Hope this would be helpful.