Apache · Configuration and operations

How do you design health checks for an Apache service?

Mediumhealth checksreliabilityoperationsUpdated Oct 2026
Quiz this track

Short answer

Expose a cheap endpoint that proves Apache can serve requests, and separate liveness from readiness. Do not make every probe depend on slow downstream services unless the orchestrator should remove the instance.

A liveness check answers whether the process should be restarted. A readiness check answers whether it should receive traffic. For Apache, a static file or a tiny handler is enough to prove the server is accepting connections and serving from the document root. A readiness check may also verify critical dependencies.

apache
Alias /health /var/www/health.txt

<Location "/health">
  Require all granted
  Header always set Cache-Control "no-store"
</Location>

<Location "/ready">
  Require all granted
  ProxyPass http://127.0.0.1:3000/ready
  ProxyPassReverse http://127.0.0.1:3000/ready
</Location>
A static liveness endpoint and a proxied readiness endpoint.

Design rules

  • Keep liveness independent of databases, caches and external APIs
  • Use readiness for dependency checks so traffic drains without restart loops
  • Return a small body and no sensitive details
  • Set a short timeout on the probe and on any downstream call it makes
  • Avoid logging every probe at info level; it floods logs
  • Do not cache health responses
  • Check the endpoint from the same network path the load balancer uses

If the readiness check calls a backend, that backend must be reachable from the Apache container or host, not just from your laptop. A probe that always returns 200 hides real failures; a probe that checks everything causes cascading restarts when a shared dependency is slow.

A health endpoint is not a monitoring strategy. Track error rate, latency and worker saturation separately; a single boolean cannot describe partial degradation.

Follow-ups you should expect

Interviewers use these to check whether the first answer was understanding or memorisation.

  1. 1What is the difference between liveness and readiness?
  2. 2Should a health check query the database?
  3. 3How do you prevent health checks from flooding logs?
  4. 4What should the load balancer do when readiness fails?

Say it in the interview

I keep liveness cheap and independent: a tiny static endpoint that proves Apache is serving. Readiness can check critical dependencies, but with strict timeouts, so the load balancer removes the instance instead of restarting it. I make sure probes are not cached and do not flood logs. A boolean health check is not a substitute for latency and error-rate monitoring.

Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.

Related questions

Reading is step one

Now say it out loud.

Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live Apache mock interview and get scored feedback on depth, clarity and confidence.