AH00526:BalancerMember 平衡器名称语法错误

AH00526: BalancerMember Bad syntax for a balancer name

我正在尝试在 CentOS 7.3 VM 上使用 Apache Httpd 2.4.6 配置负载平衡器。但是,"apachectl configtest" 失败并显示错误消息

AH00526: Syntax error on line 32 of /etc/httpd/conf/httpd.conf:
BalancerMember Bad syntax for a balancer name

虽然我已经加载了mod_proxy_http(所以http://192.168.56.2:5555应该包含一个有效的协议),并且语法与我找到的示例中的语法匹配.

有什么问题吗?我的 httpd.conf 如下所示:

ServerRoot "/etc/httpd"
Listen 5555
LoadModule unixd_module modules/mod_unixd.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
LoadModule status_module modules/mod_status.so
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
User apache
Group apache
ServerAdmin my.email@my.domain.com
ServerName center.mcjwi01.eur.ad.sag:5555
<Directory />
    AllowOverride none
    Require all denied
</Directory>

LogLevel debug

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
CustomLog "logs/access_log" combined

AddDefaultCharset UTF-8

<Proxy "balancer:iscluster">
    BalancerMember http://192.168.56.2:5555
    BalancerMember http://192.168.56.3:5555
    ProxySet lbmethod=bybusiness
</Proxy>
ProxyPass "/" "balancer:iscluster"
ProxyPassReverse "/" "balancer:iscluster"

没错,语法错误,正确应该是:

<Proxy balancer://iscluster>
    BalancerMember http://192.168.56.2:5555
    BalancerMember http://192.168.56.3:5555
    ProxySet lbmethod=bybusiness
</Proxy>
ProxyPass / balancer://iscluster/
ProxyPassReverse / balancer://iscluster/

注意:我删除了所有地方的 " 因为 afaik 它们并不是真正必要的,我还匹配了尾部斜线以避免您的代理问题。