2012-03-20 25 views
3

我剛將我的rails應用程序移動到新機器上。我使用的是Apache 2.2.3和乘客3.0.11。在初始加載數據庫之後,我間歇性地看到一個錯誤,表示rails應用程序無法啓動。下面是我在Apache的錯誤日誌中看到:乘客mod_passenger中的意外錯誤:無法連接到Unix套接字

[Sun Mar 18 04:02:13 2012] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations 
[ pid=10788 thr=47366521234240 file=ext/apache2/Hooks.cpp:860 time=2012-03-18 08:51:10.215 ]: Unexpected error in mod_passenger: Cannot connect to Unix socket '/tmp/passenger.1.0.13044/generation-0/socket': No such file or directory (2) 
Backtrace: 
in 'Passenger::ApplicationPool::Client* Passenger::ApplicationPool::Client::connect(const std::string&, const std::string&, const Passenger::StaticString&)' (Client.h:438) 
in 'Passenger::ApplicationPool::Client* Hooks::getApplicationPool()' (Hooks.cpp:266) 
in 'Passenger::SessionPtr Hooks::getSession(const Passenger::PoolOptions&)' (Hooks.cpp:292) 
in 'int Hooks::handleRequest(request_rec*)' (Hooks.cpp:561) 

我做了一些google搜索,但我只能似乎找到乘客的傢伙說給乘客升級到3.0版本,但我已經是3版本。我還看到有人說要改變logrotate腳本來重新啓動Apache而不是重新加載,這對我沒有任何幫助。有人有任何想法嗎?這是我的apache conf for乘客。我使用的是安裝作爲寶石紅寶石企業和乘客的RVM版本:

LoadModule passenger_module /usr/local/rvm/gems/ree-1.8.7-2012.02/gems/passenger-3.0.11/ext/apache2/mod_passenger.so 
PassengerRoot /usr/local/rvm/gems/ree-1.8.7-2012.02/gems/passenger-3.0.11 
PassengerRuby /usr/local/rvm/wrappers/ree-1.8.7-2012.02/ruby 

我也嘗試添加軌道產卵方法是保守型的加入最大池大小,相同的結果。不知道在哪裏轉。

回答

5

您是否啓用了SELinux?運行cat /selinux/enforce找出。如果它打印1,請嘗試使用echo 0 > /selinux/enforce禁用SELinux以查看是否可以解決問題。如果問題得到解決,您可以選擇嘗試解決該問題(例如,通過設置PassengerTempDir設置,在Passenger user guide中搜索SELinux),或者將其永久關閉。

+0

感謝您的幫助。我檢查了我的/ selinux目錄是空的,而我的/ etc/selinux/config文件顯示SELINUX = disabled。作爲一個額外的說明,我在centos上5.7 – 2012-03-21 15:20:01

+1

你的/etc/logrotate.d/httpd是否有'/ sbin/service httpd reload>/dev/null 2>/dev/null ||的postrotate命令。真的嗎?否則,你可能想嘗試重新編譯乘客 - 也許一些底層庫改變了。 – 2012-03-21 16:39:38

+0

它有相同的命令。我讀過關於這個同樣的錯誤消息的一篇文章說,將它從重新加載到重新啓動可以解決他的問題,但對我無效。我看到與重新啓動和重新加載相同的問題。 – 2012-03-21 18:43:54

1

最近我有同樣的問題。我想:

sudo /etc/init.d/httpd restart 
Stopping httpd:           [FAILED] 
Starting httpd: (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 
no listening sockets available, shutting down 
Unable to open logs 
                  [FAILED] 

截至上的解決方案,你總是可以 「真正」 重啓一切:

sudo killall httpd # <--------- 
sudo service httpd status 
httpd is stopped 
sudo service httpd start 
Starting httpd:           [ OK ] 
相關問題