Apache 2.4 proxy_balancer and lbmethod_byrequest

I'm trying to build my Apache server with static modules. But run into some problems with the proxy_balancer module. I get an error:

[ssl:info] [pid 11863] AH01876: mod_ssl/2.4.10 compiled against Server: Apache/2.4.10, Library: OpenSSL/1.0.1i
[proxy:crit] [pid 11868] AH02432: Cannot find LB Method: byrequests
[proxy_balancer:emerg] [pid 11868] (22)Invalid argument: AH01183: Cannot share balancer
[:emerg] [pid 11868] AH00020: Configuration Failed, exiting

When I look at the loaded modules using bin/apachectl -M there are no mod_lbmethod module there.

I've tryied to load the module by adding these lines to the configuration script --enable-lbmethod-byrequest and --with-lbmethod=byrequest but it does not show up in the modules list nor in the included folder.

Someone experienced this problem before and got a solution to it?


Solution 1:

This can be resolved by enabling the module mod_lbmethod_byrequests, like so:

$ sudo a2enmod lbmethod_byrequests

This wasn't required in Apache 2.2.22, but is required by Apache 2.4

Solution 2:

If you are using Apache 2.4 or above need to enable mod_lbmethod_byrequests also.But bellow 2.4 mod_proxy_balancer was enough. I also had this issue. Problem is mod_lbmethod_byrequests split off from mod_proxy_balancer in 2.3.

Solution 3:

So I found the problem.. It was a simple typo, missing the plural form "s"..

Loaded the module using --enable-lbmethod-byrequests and it worked

Solution 4:

In httpd.conf you will see following lines:

#LoadModule lbmethod_bybusyness_module "${PRODUCT_HOME}/modules/mod_lbmethod_bybusyness.so"
#LoadModule lbmethod_byrequests_module "${PRODUCT_HOME}/modules/mod_lbmethod_byrequests.so"
#LoadModule lbmethod_bytraffic_module "${PRODUCT_HOME}/modules/mod_lbmethod_bytraffic.so"

Un-comment out the line depending on the load balancing algo that you are going to use. In your case un-comment the following line:

#LoadModule lbmethod_byrequests_module "${PRODUCT_HOME}/modules/mod_lbmethod_byrequests.so"

after uncommenting:

LoadModule lbmethod_byrequests_module "${PRODUCT_HOME}/modules/mod_lbmethod_byrequests.so"

This should work fine.