mod_proxy_balancer lets Apache distribute requests across multiple backend servers — a simple, effective load balancing setup without needing a dedicated load balancer product.
<Proxy "balancer://mycluster">
BalancerMember "http://10.0.0.11:8080"
BalancerMember "http://10.0.0.12:8080"
BalancerMember "http://10.0.0.13:8080" status=+H # hot standby, used only on failure
ProxySet lbmethod=byrequests
</Proxy>
<VirtualHost *:80>
ServerName app.example.com
ProxyPass / balancer://mycluster/
ProxyPassReverse / balancer://mycluster/
</VirtualHost>
sudo a2enmod proxy proxy_http proxy_balancer lbmethod_byrequests sudo systemctl restart apache2
Health Checks Matter
Without health checking, Apache keeps sending traffic to a backend that’s actually down until requests start timing out. Enabling mod_proxy_hcheck lets Apache proactively detect and route around unhealthy backends instead of discovering failures through user-facing errors.