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.
Load balancing is the process of distributing traffic across multiple servers for high-availability (HA) and elastic scalability. Many system administrators opt for dedicated software such as HAProxy to incorporate a proxy server.
Apache load balancer is open source and provides a server application traffic distribution solution. According to recent statistics, it has been utilized in over 100,000 websites.
In my case, I got the error ProxyPass Can't find 'byrequests' lb method
as I using proxy_balancer_module
module
Error is due to the fact that I missed to uncomment below required modules in httpd.conf
LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
and
LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
Un commenting above module entries, which are commented by default, in httpd.conf file solved my issue.
(using Apache 2.4.3)
You need to load the mod_proxy_balancer. On distros which support it, the best way is to use a2enmod:
sudo a2enmod proxy_balancer
It does all the work for you.
On Apache 2.2, you will need these libraries instead:
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
You need to enable below modules in /etc/httpd/conf/httpd.conf
file.
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With