0

我为 RoR 应用程序设置了代理平衡器,并且需要一些故障排除,因此请尝试使用 /balancer-manager 页面。我也使用 /server-status 页面,它运行良好,但是当我打开http://myhost.com/balancer-manager时,我得到以下信息:

myhost.com 的负载均衡器管理器

服务器版本:Apache/2.2.15 (Unix) 服务器构建:2011 年 10 月 6 日 11:46:57

Apache/2.2.15 (Red Hat) 服务器在 myhost.com 端口 81

没有别的了。我究竟做错了什么?

配置是:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule status_module modules/mod_status.so
........
<Location /server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from localhost
    Allow from 1.1.1.1
</Location>
<Location /balancer-manager>
    SetHandler balancer-manager
    Order Deny,Allow
    Deny from all
    Allow from localhost
    Allow from 1.1.1.1
</Location>
........
<VirtualHost *:80>
........
    <Proxy balancer://MyApp_cluster>
       BalancerMember http://localhost:4001
       BalancerMember http://localhost:4002
       BalancerMember http://localhost:4003
   </Proxy>
</VirtualHost>

谷歌除了这个https://issues.apache.org/bugzilla/show_bug.cgi?id=41979什么也没给我 所以我的配置中可能有一个错误,但我无法弄清楚。谢谢你。

4

2 回答 2

1

我有同样的问题,我注意到这是由于包含语句。

例如,此代码使平衡器工作,但管理器失败(注意 Include 在虚拟主机内):

<VirtualHost *:80>

  ServerName aom.com
  ServerAlias 10.*.*.*

  DocumentRoot /var/www/vhosts/aom/htdocs
  LogLevel warn
  ErrorLog /var/www/vhosts/aom/logs/error.log
  CustomLog /var/www/vhosts/aom/logs/access.log "combined"
  Include /var/www/vhosts/aom/*.conf

  ServerSignature Off

</VirtualHost>

在这种情况下,两者都有效:

     Include /var/www/vhosts/aoe/*.conf
   <VirtualHost *:80>

      ServerName aom.com
      ServerAlias 10.*.*.*

      DocumentRoot /var/www/vhosts/aoe/htdocs
      LogLevel warn
      ErrorLog /var/www/vhosts/aom/logs/error.log
      CustomLog /var/www/vhosts/aom/logs/access.log "combined"
      Include /var/www/vhosts/aom/*.conf

      ServerSignature Off

    </VirtualHost>

如果您需要包含在虚拟主机中,则必须将处理程序放入其中,例如:

<VirtualHost *:80>

  ServerName aom.com
  ServerAlias 10.*.*.*

  DocumentRoot /var/www/vhosts/aom/htdocs
  LogLevel warn
  ErrorLog /var/www/vhosts/aom/logs/error.log
  CustomLog /var/www/vhosts/aom/logs/access.log "combined"
  <Location "/manage-balancer">
    SetHandler balancer-manager
  </Location>


  Include /var/www/vhosts/aom/*.conf

  ServerSignature Off

</VirtualHost>
于 2013-06-07T00:10:20.307 回答
0

你确定你在正确的港口?设置好像没问题。也许一些日志可以提供帮助。

于 2012-02-26T22:47:21.737 回答