Share this page:

Set up the Apache balancer manager user interface

Following on from the previous post about configuring Apache as a reverse proxy, in this post I'm going to look at setting up the balancer manager web UI.  

The balancer manager UI can be used to change settings on the load balancer without having to restart Apache.  It also provides feedback on problems with the nodes in the cluster.  

The UI is enabled by editing the virtual host file that contains the balancer settings.  In the last post, I set up the load balancer by editing the default virtual host file, so I'm going to open that file again:

sudo gedit /etc/apache2/sites/available/000-default.conf

The following code needs to be added beneath the Proxy definition:

    <Location /balancer-manager>
        SetHandler balancer-manager
        Order allow,deny
        allow from 192.168.0
    </Location>

    ProxyPass /balancer-manager !

This tells Apache that requests to the /balancer-manager URL should be handled by the balancer manager module, and it should only be accessible from addresses on subnet 192.168.0. The ProxyPass directive is used to tell Apache that requests to /balancer-manager should not be proxied - they should be handled locally by the balancer manager module.

Save the file and restart Apache:

sudo service apache2 restart

Now visit your load balancer's public IP address in a web browser with /balancer-manager added to the URL (for example, http://192.168.0.2/balancer-manager).  You should see something like this:

Load balancer manager user interface

If you click on the link for the balancer status, you'll be able to edit settings for the load balancer's timeout period, the load balancing algorithm, and failover options.

Balancer manager cluster settings

By clicking on URLs of the worker nodes, you can bring up options that control individual servers:

Load balancer manager worker settings

The load factor determines what proportion of requests are sent to a given server.  For example, if the load factor is set to 2 for one of the worker nodes, that node will be sent twice as many requests as servers that have a load factor of 1. Worker nodes can also be disabled using this interface, which is useful if you need to do maintenance on a server.  Disabling the node stops the load balancer from sending sending traffic to it, so you can work on the server without interrupting user's access to the site.

Note that any settings entered into the UI will be lost when Apache is restarted.


Comments