我在Windows 7旗舰版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系统上运行良好。
欢迎所有建议/提示/解决方案。