I am trying to set the webapp using Apache (Server version: Apache/2.4.38 (Unix)) with SSL and Tomcat (Apache Tomcat/8.5.41)

3 tomcat instances are set as str1, str2, str3 with below settings with jvmroute respectively. Server.xml as:

Connector port="8988" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"              
Connector port="8010" protocol="AJP/1.3" redirectPort="8443"
Engine name="Catalina" defaultHost="localhost" jvmRoute="str1"

In Httpd.conf with SSL module enabled and pointing httpd-ssl.conf

Listen 80
ServerName abcd.example.com:80
RewriteEngine On
RewriteCond %{SERVER_PORT} =80
RewriteRule (.*) https://abcd.example.com/search [R=301,L]

In httpd-ssl.conf

Listen 443
SSLEngine on
ServerName abcd.example.com:443

In Proxy-balancer.conf:

ProxyPass /search balancer://stcluster/search
ProxyPassReverse /search balancer://stcluster/search
<Proxy balancer://stcluster>
    BalancerMember http://localhost:8988 loadfactor=1 route=str1
    BalancerMember http://localhost:8987 loadfactor=1 route=str2
    BalancerMember http://localhost:8986 loadfactor=1 route=str3
    ProxySet lbmethod=bybusyness
    ProxySet stickysession=JSESSIONID|jsessionid
    ProxySet timeout=300
  • What is the problem with your current configuration? What is it you're expecting to happen, what's happening instead, what do the logs say? – Jenny D Jun 11 at 7:35
  • Thanks Jeni for asking. when i am hitting abcd.domain.com/search then it receives error as "The proxy server received an invalid response from an upstream server." . I am unable to locate any problem. – user3256224 Jun 11 at 7:45
  • What happens if you try to connect manually directly to the backend server from your webserver, using telnet or netcat? – Jenny D Jun 11 at 11:44
  • I am not understanding this but i guess you are asking about the DNS resolution and it works. If i hit the abcd.domain.com then itworks page comes. – user3256224 Jun 11 at 12:50
  • when hitting 'abcd.domain.com/search' then it does recognize the certificate and validates it but throws badgateway error – user3256224 Jun 11 at 12:51

I was not able to conclude beyond proxy-balancer.conf miss configuration. Not sure what. I copied the configured Apache/2.4.17 and managed to delete the older apr and finally able to solve the purpose for now.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.