2011-10-04 48 views
0

我在Windows 7旗艦版64位個人電腦上設置了Ruby on Rails應用程序。Windows 7 Ultimate 64位/ Mongrel/Apache 2.2

Mongrel的3個實例用於運行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訪問本地主機單獨沒有問題。

當我嘗試通過Apache訪問端口3009上的本地主機時,出現「服務暫時不可用」 由於維護停機或容量問題,服務器暫時無法處理您的請求,請稍後重試。錯誤信息。

在檢查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的錯誤日誌顯示連接到雜種情況下莫名其妙地失敗了。

在我看來Windows 7的問題,因爲相同的設置在Windows XP系統上正常工作。

歡迎提出所有建議/提示/解決方案。

回答

0

我建議你切換到Linux或Mac OS X,當涉及到軌道上的紅寶石,並嘗試使用Nginx。它更可靠,穩定和快速。 Rails有很多非常有用的寶石。老實說,Ruby社區並不關心Windows。事實是,這些寶石沒有更新的窗口,並在一些罕見的情況下不是爲windows兼容性而構建的。你可以嘗試用Ubuntu(我經常使用它)弄髒你的雙手,並且也跳到nginx或者WEBrick,這是你自己已經知道的ruby安裝本身。因此,要充分利用Ruby on Rails,走出Windows將是更好的選擇。 Read This

+0

終於找到了答案。我必須從windows/system32/drivers/etc/hosts文件中刪除行「:: 1」。 – user977845