Enabling mod_status for Monitoring Apache HTTPD 🌱

Enabling mod_status in Apache HTTPD

  1. Navigate to the PHP install directory
  2. Edit /php.ini
  3. Press CTRL+F, type curl, press Enter
  4. Uncomment the extension to enable it by removing the ; at the start of the line

    extension=curl

  5. Navigate to the Apache install directory
  6. Edit /conf/httpd.conf
  7. Press CTRL+F, type mod_status, press Enter
  8. Uncomment the module to enable it by removing the # at the start of the line

    LoadModule status_module modules/mod_status.so

  9. At the bottom of the file paste the following

    ExtendedStatus On
    <location /server-status>
    SetHandler server-status
    Order allow,deny
    Allow from all
    </location>

  10. Note: By default this will only allow access from the host Apache is running on
  11. Restart the Apache service to apply the changes
  12. Open a web browser and navigate to http://DNSorIP/server-status
    1. ?refresh=5 will refresh the display every 5 seconds
    2. ?auto will display the output in a text only format
  13. Cringe at the output displayed

Style and Modernize /server-status

  1. Download PHP Simple DOM Download Documentation
  2. Create a status folder inside apache/htdocs
  3. Copy/Paste simple_html_dom.php inside apache/htdocs/status
  4. Download server-status.php Download
  5. Copy/Paste server-status.php inside apache/htdocs/status
  6. Open a web browser and navigate to http://DNSorIP/status/server-status.php
    1. ?getStatus will return a JSON output of the server-status data