【发布时间】:2011-11-30 10:13:32
【问题描述】:
我在 Windows 7 Ultimate 64 位 PC 上设置了 Ruby on Rails 应用程序。
3 个 Mongrel 实例用于运行 rails 程序,它们由 Apache 2.2 进行负载平衡。
我的 httpd.conf 文件的相关部分如下:
---------- httpd.conf
#define mongrel cluster
<proxy balancer://mongrelcluster>
BalancerMember http://127.0.0.1:3001
BalancerMember http://127.0.0.1:3002
BalancerMember http://127.0.0.1:3003
</proxy>
Listen 3009
#forward requests to mongrel cluster
<virtualhost *:3009>
ProxyPass / balancer://mongrelcluster/
ProxyPassReverse / balancer://mongrelcluster/
ProxyPreserveHost on
</virtualhost>
----------- httpd.conf
我可以在 3001、3002 和 3003 端口单独访问 localhost,没有问题。
当我尝试通过 Apache 访问端口 3009 的 localhost 时,我得到一个“服务暂时不可用 由于维护停机或容量问题,服务器暂时无法满足您的请求。请稍后再试。”错误消息。
在检查 Apache 错误日志时:
---- Error log
[Tue Oct 04 12:46:37 2011] [notice] Child 6168: Child process is running
[Tue Oct 04 12:46:38 2011] [notice] Child 6168: Acquired the start mutex.
[Tue Oct 04 12:46:38 2011] [notice] Child 6168: Starting 64 worker threads.
[Tue Oct 04 12:46:38 2011] [notice] Child 3052: Released the start mutex
[Tue Oct 04 12:46:39 2011] [notice] Child 3052: All worker threads have exited.
[Tue Oct 04 12:46:39 2011] [notice] Child 3052: Child process is exiting
[Tue Oct 04 12:46:39 2011] [notice] Child 6168: Starting thread to listen on port 80.
[Tue Oct 04 12:46:39 2011] [notice] Child 6168: Starting thread to listen on port 3009.
[Tue Oct 04 12:46:46 2011] [error] (OS 10013)An attempt was made to access a socket in a way forbidden by its access permissions. : proxy: HTTP: attempt to connect to 127.0.0.1:3001 (127.0.0.1) failed
[Tue Oct 04 12:46:46 2011] [error] ap_proxy_connect_backend disabling worker for (127.0.0.1)
[Tue Oct 04 12:46:46 2011] [error] (OS 10013)An attempt was made to access a socket in a way forbidden by its access permissions. : proxy: HTTP: attempt to connect to 127.0.0.1:3002 (127.0.0.1) failed
[Tue Oct 04 12:46:46 2011] [error] ap_proxy_connect_backend disabling worker for (127.0.0.1)
[Tue Oct 04 12:46:46 2011] [error] (OS 10013)An attempt was made to access a socket in a way forbidden by its access permissions. : proxy: HTTP: attempt to connect to 127.0.0.1:3003 (127.0.0.1) failed
[Tue Oct 04 12:46:46 2011] [error] ap_proxy_connect_backend disabling worker for (127.0.0.1)
---- Error log
Apache 错误日志显示与 Mongrel 实例的连接以某种方式失败。
在我看来这是一个 Windows 7 问题,因为相同的设置在 Windows XP 系统上运行良好。
欢迎所有建议/提示/解决方案。
【问题讨论】:
标签: ruby-on-rails windows apache mongrel