2016-11-15 56 views
1

,而我通過Capistrano的部署我的Rails應用程序到我的CentOS的服務器,我已經收到此錯誤的所有時間:CentOS的*** ERROR:客運的Phusion似乎沒有運行

*** ERROR: Phusion Passenger doesn't seem to be running. If you are sure that it is running, then the causes of this problem could be one of:

  1. You customized the instance registry directory using Apache's PassengerInstanceRegistryDir option, Nginx's passenger_instance_registry_dir option, or Phusion Passenger Standalone's --instance-registry-dir command line argument. If so, please set the environment variable PASSENGER_INSTANCE_REGISTRY_DIR to that directory and run this command again.
  2. The instance directory has been removed by an operating system background service. Please set a different instance registry directory using Apache's PassengerInstanceRegistryDir option, Nginx's passenger_instance_registry_dir option, or Phusion Passenger Standalone's --instance-registry-dir command line argument.

在我的服務器我有apache和乘客5.0.30 首先我在看別人的答案在這裏堆棧: Link to one of these topics。 不幸的是沒有任何東西沒有幫助我。我試圖從apache conf設置env路徑和其他設置。 任何想法我應該改變以部署我的rails應用程序? PATH中第一個乘客身份的完整路徑在哪裏?它與passenger_root相匹配嗎? 下面是我的日誌:

$ passenger-config validate-install 


> What would you like to validate? Use <space> to select. If the menu 
> doesn't display correctly, press '!' 
> 
> ⬢ Passenger itself ‣ ⬢ Apache 
> 
> ------------------------------------------------------------------------- 
> 
> Checking whether there are multiple Apache installations... Only a 
> single installation detected. This is good. 
> 
> ------------------------------------------------------------------------- 
> 
> * Checking whether this Passenger install is in PATH... ✓ * Checking 
> whether there are no other Passenger installations... ✓ * Checking 
> whether Apache is installed... ✓ * Checking whether the Passenger 
> module is correctly configured in Apache... ✓ 
> 
> Everything looks good. :-) 




$ rvmsudo passenger-memory-stats 

Version: 5.0.30 
Date : 2016-11-15 13:43:44 +0100 

---------- Apache processes ---------- 
PID PPID VMSize Private Name 
-------------------------------------- 
25188 1  476.6 MB 1.5 MB /usr/sbin/httpd -DFOREGROUND 
25220 25188 270.4 MB 0.5 MB /usr/sbin/httpd -DFOREGROUND 
25246 25188 478.6 MB 0.2 MB /usr/sbin/httpd -DFOREGROUND 
25247 25188 478.6 MB 0.2 MB /usr/sbin/httpd -DFOREGROUND 
25248 25188 478.6 MB 0.2 MB /usr/sbin/httpd -DFOREGROUND 
25249 25188 478.6 MB 0.2 MB /usr/sbin/httpd -DFOREGROUND 
25250 25188 478.6 MB 0.2 MB /usr/sbin/httpd -DFOREGROUND 
### Processes: 7 
### Total private dirty RSS: 3.08 MB 


-------- Nginx processes -------- 

### Processes: 0 
### Total private dirty RSS: 0.00 MB 


----- Passenger processes ----- 
PID VMSize Private Name 
------------------------------- 
25222 421.0 MB 0.9 MB Passenger watchdog 
25225 772.6 MB 1.5 MB Passenger core 
25234 431.3 MB 1.0 MB Passenger ust-router 
### Processes: 3 
### Total private dirty RSS: 3.39 MB 

我的Apache的配置文件:

<VirtualHost *:80> 
    ServerName www.app.com 
    ServerAdmin admin 

    DocumentRoot "/srv/www/app_name/current/public" 

LoadModule passenger_module /home/userr/.rvm/gems/ruby-2.2.5/gems/passenger-5.0.30/buildout/apache2/mod_passenger.so 

#<IfModule mod_passenger.c> 
# PassengerRuby /usr/local/rvm/gems/ruby-2.2.5 
# PassengerRoot /usr/local/rvm/gems/ruby-2.2.5/gems/passenger-5.0.30 
# PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.2.5/wrappers/ruby 
# PassengerInstanceRegistryDir /tmp 
#</IfModule> 

<IfModule mod_passenger.c> 
     PassengerRoot /home/userr/.rvm/gems/ruby-2.2.5/gems/passenger-5.0.30 
     PassengerDefaultRuby /home/userr/.rvm/gems/ruby-2.2.5/wrappers/ruby 
     PassengerInstanceRegistryDir /tmp 
</IfModule> 

    Options -Indexes -FollowSymLinks -MultiViews 

    LogLevel warn 
    ErrorLog logs/www.app.com-error.log 
    TransferLog logs/www.app.com-access.log 
    CustomLog logs/www.app.cp,.log combined 

<Directory /srv/www/app_name/current/public> 
    AddDefaultCharset UTF-8 

    <IfModule mod_authz_core.c> 
    # Apache 2.4 
    <RequireAny> 
     Require all granted 
    </RequireAny> 
    </IfModule> 
    <IfModule !mod_authz_core.c> 
    # Apache 2.2 
    Order Deny,Allow 
    Deny from All 
    Allow from All 
    </IfModule> 
</Directory> 

</VirtualHost> 

我的ENV路徑:

env file: 
    SHELL=/bin/bash 
    PATH=/sbin:/bin:/usr/sbin:/usr/bin 
    LOGNAME=root 
    USER=root 
    USERNAME=root 
    HOME=/root 
    SUDO_COMMAND=/bin/env PASSENGER_INSTANCE_REGISTRY_DIR=/tmp 
    SUDO_USER=userr 
    SUDO_UID=1001 
    SUDO_GID=100 
    PASSENGER_INSTANCE_REGISTRY_DIR=/tmp 

我肯定正在做一些錯誤。感謝您的每一個建議。

回答

0

最後我解決了我的問題。 我做了兩件事。

首先,我在我的主目錄中創建了新的臨時文件夾。然後在Apache的配置文件,我增加

PassengerInstanceRegistryDir /home/userr/instancetemp 

然後我就這我ENV路徑與

echo 'PASSENGER_INSTANCE_REGISTRY_DIR=/home/userr/instancetemp' >> ~/.bash_profile 

我覺得這是不夠好,但我還添加了這條道路我Capistrano的配置

set :default_env, { 
    "PASSENGER_INSTANCE_REGISTRY_DIR" => "/home/t.panek/passenger_temp" 
} 
0

問題似乎是系統專用臨時功能,您可以禁用httpd:

mkdir /etc/systemd/system/httpd.service.d 
echo "[Service]" > /etc/systemd/system/httpd.service.d/nopt.conf 
echo "PrivateTmp=false" >> /etc/systemd/system/httpd.service.d/nopt.conf 
systemctl daemon-reload 
systemctl restart httpd 

乘客5.0不再使用/tmp獲取狀態信息,因此即使在私人臨時工作時,它也應該可以工作。

相關問題