Issue
I am trying to configure a load balancer using Apache Httpd 2.4.6 on a CentOS 7.3 VM. However, "apachectl configtest" fails with the error message
AH00526: Syntax error on line 32 of /etc/httpd/conf/httpd.conf:
BalancerMember Bad syntax for a balancer name
Although I have loaded mod_proxy_http (so http://192.168.56.2:5555 should contain a valid protocol), and the syntax matches those in the examples I've found.
Any ideas on what's wrong? My httpd.conf looks like follows:
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 [email protected]
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"
Solution
Exactly, syntax is wrong, correctly it should be:
<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/
Note: I removed the " everywhere because afaik they are not really necessary, I also matched trailing slashes to avoid issues with your proxying.
Answered By - ezra-s Answer Checked By - Mildred Charles (WPSolving Admin)