Windows 7 旗舰版 64 位 / Mongrel / Apache 2.2

发布于 2024-12-08 03:00:10 字数 2499 浏览 1 评论 0原文

我已在 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 系统上运行良好。

欢迎所有建议/提示/解决方案。

I've set up a Ruby on Rails application on a Windows 7 Ultimate 64-bit PC.

3 instances of Mongrel are used to run the rails program and they are load balanced by Apache 2.2.

Relevant section of my httpd.conf file is as followed:

---------- 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

I can access localhost at ports 3001, 3002 and 3003 individually without problems.

When I try to access localhost at port 3009 via Apache, I get an "Service Temporarily Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later." error message.

Upon checking the Apache error logs:

---- 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 

The Apache error log shows that connection to the Mongrel instances failed somehow.

It appears to me a Windows 7 issue because the same setup works fine on a Windows XP system.

All suggestions / tips / solutions are welcome.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

长途伴 2024-12-15 03:00:10

当谈到 ruby​​ on Rails 时,我建议您切换到 Linux 或 Mac OS X,并尝试使用 Nginx。它更加可靠、稳定和快速。 Rails 有很多非常有用的宝石。老实说,Ruby 社区并不关心 Windows。事实上,这些 gem 并未针对 Windows 进行更新,并且在极少数情况下也不是为 Windows 兼容性而构建的。你可以尝试使用 Ubuntu(我经常使用它),也可以跳转到 nginx 或 WEBrick,它们本身就带有 ruby​​ 安装,正如你已经知道的那样。
因此,为了充分利用 Ruby on Rails,离开 Windows 将是更好的选择。

I would suggest you to switch to Linux or Mac OS X when it comes to ruby on rails and try your hands with Nginx. It is much more reliable, stable and fast. Rails has lots of gems which are very useful. The ruby community, to be honest, just doesn't care about windows. The fact is that these gems are not updated for windows and in some rare cases not built for windows compatibility. You can try and get your hands dirty with Ubuntu(which i use on a very regular basis) and also make a jump to nginx or WEBrick which comes with ruby installation itself,as you already know it.
Thus, to make the best of Ruby on Rails, getting out of windows would be a better option. Read This

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文