
Apache HTTP Server remains one of the most widely deployed web servers in the world, powering millions of sites and applications. While Apache is reliable, it can still fail — processes crash, configuration errors prevent restarts, SSL certificates expire, and upstream applications become unavailable.
Effective Apache monitoring combines external HTTP checks with server-level health endpoints to give you complete visibility.
Understanding failure modes helps you monitor the right things:
systemctl reload apache2 with a bad config causes Apache to fail to restart cleanlyExternal HTTP monitoring catches all of these. If Apache is down for any reason, HTTP checks fail.
Configure an external uptime monitor pointing at your domain:
Monitor: https://yourdomain.com
Method: GET
Expected status: 200
Check interval: 1 minute
This is the most important check. It validates DNS resolution, port accessibility, Apache running, SSL certificate validity, and application response in a single check.
For applications served by Apache, also monitor critical application endpoints — the homepage alone doesn't tell you if your application is working.
Use multi-location monitoring to check from multiple geographic regions, catching CDN issues and regional network problems that a single-location check would miss.
Add a lightweight health endpoint to your Apache configuration:
# In your Apache virtualhost config
<Location "/health">
SetHandler default-handler
DirectoryIndex disabled
Require all granted
Header always set Content-Type "text/plain"
# Returns 200 with "OK" body
</Location>
# Or create a static file
# /var/www/html/health returns "OK"
Alternatively, use a simple PHP or static file:
Alias /health /var/www/health/health.html
<Directory /var/www/health>
Require all granted
</Directory>
Monitor https://yourdomain.com/health for a fast, lightweight availability check that's separate from your main application.
Enable the Apache server status module for internal metrics:
# Enable mod_status
LoadModule status_module modules/mod_status.so
<Location "/server-status">
SetHandler server-status
Require host localhost
</Location>
The /server-status endpoint provides:
Access locally: curl http://localhost/server-status?auto
For external monitoring, this endpoint should be restricted to localhost (as shown above) — don't expose it publicly.
If Apache terminates SSL:
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/yourdomain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/yourdomain.com/privkey.pem
</VirtualHost>
An expired or missing certificate causes Apache to fail to serve HTTPS. Set up SSL certificate monitoring with alerts at 30 days before expiry.
Configure Apache to automatically restart on failure:
# /etc/systemd/system/apache2.service.d/restart.conf
[Service]
Restart=on-failure
RestartSec=5s
This restarts Apache if it crashes. External monitoring detects if the restart loop is failing (Apache keeps crashing, causing repeated brief outages).
Before any reload or restart, validate the configuration:
apache2ctl configtest
# OR
apachectl -t
Always run this before systemctl reload apache2 to catch syntax errors that would prevent Apache from starting.
Apache log files are your first diagnostic resource:
/var/log/apache2/error.log — Apache errors, SSL issues, upstream failures
/var/log/apache2/access.log — All requests with status codes
When an uptime monitor fires, checking error logs around the incident start time reveals the cause. Set up log aggregation (ELK stack, Loki, Papertrail) so logs are searchable and retained.
| Failure | External Monitor Shows | Diagnosis |
|---|---|---|
| Apache process crash | Connection refused / timeout | Check systemd status, error.log |
| Config error after reload | Connection refused | Check apachectl configtest |
| SSL cert expired | SSL handshake error | Check certificate expiry |
| Upstream app down (mod_proxy) | 502 Bad Gateway | Check upstream application |
| Worker exhaustion | Slow responses or timeout | Check server-status, increase MaxRequestWorkers |
| Disk full | 500 errors or timeout | Check df -h |
For production Apache servers, configure:
Use a 2-failure confirmation count to avoid false alarms from brief network blips between the monitoring server and yours. See downtime alert configuration for details.
Monitor your Apache web server with external HTTP and SSL monitoring at Domain Monitor.
A subdomain takeover lets an attacker claim your subdomain by exploiting dangling DNS records. Learn how it happens, real-world examples, and how DNS monitoring detects it.
Read moreMean time to detect (MTTD) measures how long it takes to discover an incident after it starts. Reducing MTTD is one of the highest-leverage improvements in reliability engineering.
Read moreBlack box monitoring tests your systems from the outside, the way users experience them — without access to internal code or infrastructure. Learn how it works and when to use it.
Read moreLooking to monitor your website and domains? Join our platform and start today.