27

4, I tried configuring load balancer in apache web server but unsuccessfully.
In my httpd.conf

LoadModule proxy_module modules/mod_proxy.so

<VirtualHost mysuperwebapp.com:80>
    ServerName mysuperwebapp.com
    <Location /balancer-manager>
        SetHandler balancer-manager
        Order Deny,Allow
        Deny from all
        Allow from .mysuperwebapp.com
    </Location>
    <Proxy balancer://mycluster>
        BalancerMember http://localhost:9999
        BalancerMember http://localhost:9998 status=+H
    </Proxy>
    <Proxy *>
        Order Allow,Deny
        Allow From All
    </Proxy>
    ProxyPreserveHost On
    ProxyPass /balancer-manager !
    ProxyPass / balancer://mycluster/
    ProxyPassReverse / http://localhost:9999/
    ProxyPassReverse / http://localhost:9998/
</VirtualHost>

When I start the apache service, it said that

AH00526: Syntax error on line 184 of /Users/aptos/Documents/workspace/Webserver/conf/httpd.conf:
BalancerMember Can't find 'byrequests' lb method

Can somebody show me where I did incorrectly? Thank you very much.

4

5 回答 5

36

就我而言,我在ProxyPass Can't find 'byrequests' lb method使用proxy_balancer_module模块时遇到了错误

错误是由于我错过了在 httpd.conf 中所需模块下方取消注释的事实

LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so

LoadModule slotmem_shm_module modules/mod_slotmem_shm.so

在 httpd.conf 文件中取消对上面默认注释的模块条目的注释解决了我的问题。

(使用 Apache 2.4.3)

于 2013-01-30T13:35:03.680 回答
8

您需要加载 mod_proxy_balancer。在支持它的发行版上,最好的方法是使用 a2enmod:

sudo a2enmod proxy_balancer

它为您完成所有工作。

于 2013-11-05T17:51:34.560 回答
4

在 Apache 2.2 上,您将需要这些库:

LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
于 2013-10-21T22:33:13.633 回答
1

您需要在/etc/httpd/conf/httpd.conf文件中启用以下模块。

LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
于 2016-12-28T07:30:25.000 回答
0

答案是包括

LoadModule proxy_balancer_module modules/mod_proxy_balancer.so

或者对于 IBM WebSPhere

LoadModule proxy_balancer_module modules/WebSphereCE/mod_proxy_balancer.so
于 2013-11-12T19:40:09.833 回答