Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have setup a load balancer with Apache 2.2 via mod_proxy and mod_proxy_balancer. The load balancing works just fine, but there is one case I cannot find any configuration options for, namely, while using persistent connections to the backend servers, when one of them dies (shuts down, crashes, etc ), the existing connections to it still try to access it. Is there a way to configure the apache Load Balancer so that it quits or recreates connections to dead backend servers? In the LVS world the Ldirector has an option under Proc FS that governs just that:


When this is set persisten sessions / connections ot a dead backend server will be flushed so that on the next client request they can be recreated.

Is there something similar to it in the Apache world?

Thanks in adavnce!

Cheers, Konstantin Boyanov

P.S. In what manner does Apache check the status of the backend servers? Does it try to connect to some port or something like that? It would be great if someone can shed some ligjt on that too!

Here is my virtual host configuration file:

ServerAdmin ServerName

DocumentRoot /srv/www/vhosts/

ErrorLog /var/log/apache2/
CustomLog /var/log/apache2/ combined

HostnameLookups Off
UseCanonicalName Off
ServerSignature On
ScriptAlias /cgi-bin/ "/srv/www/vhosts/"

<Location /balancer-manager>
    SetHandler balancer-manager
    Order Deny,Allow
    Deny from all
    Allow from all

<Location /server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from bmf.intern.netz

<Proxy balancer://myapp>
    BalancerMember loadfactor=10 route=1 connectiontimeout=200ms
    BalancerMember loadfactor=10 route=2 connectiontimeout=200ms
    ProxySet stickysession=ROUTEID
    ProxySet lbmethod=byrequests

ProxyPass /balancer-manager !
ProxyPass /server-status !
ProxyPass / balancer://myapp/ lbmethod=byrequests
ProxyPassReverse / balancer://myapp/

<Directory "/srv/www/vhosts/">
    AllowOverride None
    Options +ExecCGI -Includes
    Order allow,deny
    Allow from all

<IfModule mod_userdir.c>
    UserDir public_html
    Include /etc/apache2/mod_userdir.conf

# This should be changed to whatever you set DocumentRoot to.
<Directory "/srv/www/vhosts/">

    Options Indexes FollowSymLinks
    AllowOverride None

    Order allow,deny
    Allow from all


share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.