0

I am working on load balancing 2 servers which have different domain names. Currently, it's working good for Server1, where load-balancing configuration and 1 instance of Tomcat is present, but not for server2. I am getting an AJP failure. I even tried with HTTPS, but no luck. What am I doing wrong?

Error log :

(110)Connection timed out: AH00957: HTTPS: attempt to connect to SERVER_2_IP:8445 (SERVER_2_IP) failed
[Tue Feb 26 09:53:40.020390 2019] [proxy:error] [pid 16991:tid 140154131154688] AH00959: ap_proxy_connect_backend disabling worker for (SERVER_2_IP) for 60s
[Tue Feb 26 09:53:40.020400 2019] [proxy_http:error] [pid 16991:tid 140154131154688] [client CLIENT_IP:40082] AH01114: HTTP: failed to make connection to backend: SERVER_2_IP

Server1 : sites-enabled/000-default.conf :

<VirtualHost *:443>
ServerName DOmain.de
ServerAlias www.domain.de
SSLEngine on
SSLProxyEngine on
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off
SSLCertificateFile /etc/letsencrypt/live/domain.de/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/domain.de/private.key
SSLCertificateChainFile /etc/letsencrypt/live/domain.de/chain.pem
<Proxy balancer://mycluster>
       BalancerMember ajp://IP:8009 route=server1
       BalancerMember https://IP2:8445 route=server2
</Proxy>
 ProxyPass /balancer-manager !
 ProxyPass / balancer://mycluster/
</VirtualHost>

Server 2 tomcat :

<Connector port="8445" enableLookups="true" protocol="HTTP/1.1" SSLEnabled="true" 
maxThreads="200" disableUploadTimeout="true" connectionTimeout="36000"
compression="off" sslProtocols="TLS" sslEnabledProtocols="TLSv1.2,TLSv1.1,TLSv1" ciphers="TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TL$
ECDHE_RSA_WITH_AES_256_CBC_SHA384,
 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_RC4_128_SHA, TLS_RSA_WITH_AES_128_CBC_SHA256,
TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA,SSL_RSA_WITH_RC4_128_SHA"
 compressionMinSize="1024" scheme="https" secure="true" clientAuth="false" 
keystoreFile="/etc/letsencrypt/live/Domain2.de/keystore.jks" keyPass="PASSWORD" keyAlias="tomcat" keystorePass="PASSWORD" URIEncoding="utf-8"/>


    <Connector port="8012" protocol="AJP/1.3" redirectPort="8445" connectionTimeout="10000" keepAliveTimeout="10000" />

I have also given :

/sbin/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 8445 -j ACCEPT
/sbin/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 8012 -j ACCEPT
service iptables save.

Still no luck, server 2 doesn't respond.

  • is mod_proxy_ajp installed? I would advise posting errors verbatim instead of mentioning them. – Rui F Ribeiro Feb 26 at 8:48
  • @RuiFRibeiro : My bad, I forgot to add error log. I have added error log at top of main post. For mod_proxy_ajp I am getting : a2enmod mod_proxy_ajp ERROR: Module mod_proxy_ajp does not exist!. However, it works for server1... – We are Borg Feb 26 at 8:56
  • Something seems off there. Supposing 8445 is the right port, is it listening in any interface besides localhost? – Rui F Ribeiro Feb 26 at 9:02
  • @RuiFRibeiro : How can I know that? I have opened that port with the iptables command I mentioned. – We are Borg Feb 26 at 9:02
  • @Freddy : I have another balancer which is for port-80. It's like BalancerMember Server2_ip:8086 route=server2, but still no response. Module proxy already enabled, Module proxy_http already enabled. Thank you. – We are Borg Feb 26 at 9:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.