Apache monitoring is one of the simplest things to set up monitoring for as all that is required is a modification to the httpd.conf file to turn on the server-status page and allowing the device you wish to monitor from.
Doing that is fairly straightforward.
First thing to do is shutdown Apache with the command
1 |
sudo apachectl -k graceful-stop |
This will stop Apache gracefully. Once you have run that command go to your Apache config directory. Mine is /etc/httpd/conf/
once inside there you’ll want to edit your httpd.conf using
1 |
sudo nano httpd.conf |
once inside you’ll want to look for the line
1 |
# ExtendedStatus On |
You’ll want to un-comment that line (remove the #), then keep scrolling down looking for the something similar to these lines.
1 2 3 4 5 6 |
<Location /server-status> SetHandler server-status Order deny,allow Deny from all Allow from localhost </Location> |
These may be commented out, so un-comment those and add the add the address of where you are monitoring from so it looks something like this.
1 2 3 4 5 6 |
<Location /server-status> SetHandler server-status Order deny,allow Deny from all Allow from localhost 192.168.0.1 </Location> |
Once thats done, write out the changes and close. You can then restart Apache using.
1 |
sudo apachectl -k graceful |
Then test by going to http://somedomain/server-status from the address you allowed and you should see a server status page.