I would like to create a load-balanced environment using Apache 2.4.43 (windows) and two Tomcats servers.
Using the "mod_proxy_hcheck" module some basic healthcheck operations should be implemented, which are based on the official documentation: https://httpd.apache.org/docs/2.4/mod/mod_proxy_hcheck.html
My config
ProxyHCExpr ok2 {%{REQUEST_STATUS} =~ /^[2]/}
<Proxy balancer://appcluster>
BalancerMember http://localhost:8080/app-SNAPSHOT route=server1 secret=1337 hcmethod=HEAD hcexpr=ok2 hcinterval=10 hcpasses=2 hcfails=3
BalancerMember http://localhost:9090/app-SNAPSHOT route=server2 secret=1337 hcmethod=HEAD hcexpr=ok2 hcinterval=10 hcpasses=2 hcfails=3
ProxySet lbmethod=byrequests
ProxySet stickysession=JSESSIONID|jsessionid
</Proxy>
ProxyPass /app-SNAPSHOT balancer://appcluster
ProxyPassReverse /app-SNAPSHOT balancer://appcluster
My problem: Whenever I use any parameter documented in the mod_proxy_hcheck docs, my Server fails to start. The following error-message is logged in the Winodws Event-Viewer
The Apache service named reported the following error:
Invalid command 'ProxyHCExpr', perhaps misspelled or defined by a module not included in the server configuration.
I've played around and removed those mod_proxy_hcheck
related params like ProxyHCExpr, hcfails, hcpasses, hcinterval, hcexpr, hcmethod
, but whenever one is activated, the service crashes during startup.
What I've tried/searched:
- I've searched for the
mod_proxy_hcheck
module in my httpd.conf
file, but it is not listed here. So I have checked the <apacheInstallDir>\modules
: The file mod_proxy_hcheck.so
exists
- I've added the line
LoadModule proxy_hcheck_module modules/mod_proxy_hcheck.so
to my httpd.conf
, but service-startup fails.
Any ideas left?