我正在尝试使用带有 SSL 和 Tomcat (Apache Tomcat/8.5.41) 的 Apache (服务器版本:Apache/2.4.38 (Unix)) 设置 webapp
3 个 tomcat 实例分别设置为 str1、str2、str3,jvmroute 设置如下。Server.xml 为:
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"
在 Httpd.conf 中启用 SSL 模块并指向 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]
在 httpd-ssl.conf 中
Listen 443
SSLEngine on
ServerName abcd.example.com:443
在 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
</Proxy>
答案1
除了 proxy-balancer.conf 丢失配置之外,我无法得出结论。不确定是什么。我复制了配置的 Apache/2.4.17,并设法删除了较旧的 apr,最终解决了目前的问题。