繁体   English   中英

在 Apache (httpd) 配置的一个 VirtualHost 中使用 mod_proxy_cluster 和 mod_proxy

[英]Using mod_proxy_cluster and mod_proxy in one VirtualHost of Apache (httpd) configuration

我有几个 JBoss 和 Tomcat 服务器的环境。 它们通过 modcluster 模块连接到 Apache(连接到 Apache IP 地址和端口 8090)。 Apache 包含配置:

负载均衡器配置文件

LoadModule slotmem_module modules/mod_slotmem.so
LoadModule manager_module modules/mod_manager.so
LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
LoadModule advertise_module modules/mod_advertise.so

Listen *:8090
<VirtualHost *:8090>

 <Location /mod_cluster_manager>
    SetHandler mod_cluster-manager
    Order deny,allow
    Deny from 8.8.8.8
    Allow from all
  </Location>

  KeepAliveTimeout 60
  MaxKeepAliveRequests 100
  EnableMCPMReceive
  ManagerBalancerName My_Cluster
  AdvertiseFrequency 5

</VirtualHost>

<VirtualHost *:443>
    SSLEngine on
    SSLCertificateFile /etc/pki/tls/certs/ca.crt
    SSLCertificateKeyFile /etc/pki/tls/private/ca.key

ProxyPass /other_app http://192.168.100.70:8080/other_app
ProxyPassReverse /other_app http://192.168.100.70:8080/other_app

ProxyPass / balancer://My_Cluster

</VirtualHost>  

一切正常,但一个新应用程序不支持与 Apache 的连接。 我需要使用 ProxyPass。 当我将 ProxyPass 插入 443 虚拟主机时,所有平衡的上下文都停止工作。 当我插入时: ProxyPass / balancer://My_Cluster /other_app 上下文停止工作。

你能告诉我如何通过 ProxyPass 和 modcluster 平衡器配置所有其他上下文的上下文 /other_app 处理吗?

尝试使用以下顶级指令(在 LoadModule 的正下方添加)

#This is needed to prevent mod_cluster creating balancer for all VH's
CreateBalancers 1

设法做到了以下几点:

ProxyPass /other_app http://192.168.100.70:8080/other_app
ProxyPassReverse /other_app http://192.168.100.70:8080/other_app
ProxyPass /other_app !

ProxyPass / balancer://My_Cluster

灵感来自https://serverfault.com/questions/363788/serve-all-requests-via-proxy-except-a-specific-one

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM