无法启动 Nginx 引擎:nginx: [alert] 无法启动 Phusion Passenger 看门狗

Could not start the Nginx engine: nginx: [alert] Unable to start the Phusion Passenger watchdog

我在我的 centos 6 vps 上安装了 passenger standalone,我想 运行 它成为 apache 反向代理。我检查了其他发布的问题,发现他们的解决方案不适用于独立...它涉及 rails 上的 ruby,我根本不知道。

问题是当我启动 passenger sudo passenger start 应用程序时出现此错误:

Could not start the Nginx engine: nginx: [alert] Unable to start the Phusion Passenger watchdog because it encountered the following error during startup: Unable to start the Passenger core: it seems to have crashed during startup for an unknown reason, with exit code 1 (-1: Unknown error)

错误是关于 Nginx 但我没有安装任何..并且在乘客独立安装中没有推荐它工作的地方。

我去查看我的日志文件,发现了一些我不明白的地方:

[ N 2017-12-02 06:19:54.7231 24223/T1 age/Wat/WatchdogMain.cpp:1267 ]: Starting Passenger watchdog... [ E 2017-12-02 06:19:54.7880 24226/T1 age/Sha/Fun/Initialization.cpp:569 ]: *** ERROR: Cannot open /var/www/mainfolder/myapp/passenger.3000.log for writing: Permission denied (errno=13)
     in 'Passenger::VariantMap Passenger::Agent::Fundamentals::initializeAgent(int, char***, const char*, void (*)(int, const char**, Passenger::VariantMap&), void (*)(Passenger::VariantMap&), int)' (Initialization.cpp:538)

[ W 2017-12-02 06:19:55.7969 24223/T1 age/Wat/WatchdogMain.cpp:353 ]: Cannot open cleanup PID file /tmp/passenger-standalone.10mxrug/temp_dir_toucher.pid 2017/12/02 06:19:54 [alert] 24220#0: Unable to start the Phusion Passenger watchdog because it encountered the following error during startup: Unable to start the Passenger core: it seems to have crashed during startup for an unknown reason, with exit code 1 (-1: Unknown error) [ N 2017-12-02 06:21:21.6338 24269/T1 age/Wat/WatchdogMain.cpp:1267 ]: Starting Passenger watchdog... [ E 2017-12-02 06:21:21.6456 24272/T1 age/Sha/Fun/Initialization.cpp:569 ]: *** ERROR: Cannot open /var/www/mainfolder/myapp/passenger.3000.log for writing: Permission denied (errno=13)
     in 'Passenger::VariantMap Passenger::Agent::Fundamentals::initializeAgent(int, char***, const char*, void (*)(int, const char**, Passenger::VariantMap&), void (*)(Passenger::VariantMap&), int)' (Initialization.cpp:538)

[ W 2017-12-02 06:21:22.6516 24269/T1 age/Wat/WatchdogMain.cpp:353 ]: Cannot open cleanup PID file /tmp/passenger-standalone.1pdjhr4/temp_dir_toucher.pid 2017/12/02 06:21:21 [alert] 24266#0: Unable to start the Phusion Passenger watchdog because it encountered the following error during startup: Unable to start the Passenger core: it seems to have crashed during startup for an unknown reason, with exit code 1 (-1: Unknown error) [ N 2017-12-02 07:01:35.1783 25608/T1 age/Wat/WatchdogMain.cpp:1267 ]: Starting Passenger watchdog... [ E 2017-12-02 07:01:35.1919 25611/T1 age/Sha/Fun/Initialization.cpp:569 ]: *** ERROR: Cannot open /var/www/mainfolder/myapp/passenger.3000.log for writing: Permission denied (errno=13)
     in 'Passenger::VariantMap Passenger::Agent::Fundamentals::initializeAgent(int, char***, const char*, void (*)(int, const char**, Passenger::VariantMap&), void (*)(Passenger::VariantMap&), int)' (Initialization.cpp:538)

[ W 2017-12-02 07:01:36.1992 25608/T1 age/Wat/WatchdogMain.cpp:353 ]: Cannot open cleanup PID file /tmp/passenger-standalone.2zbgfm/temp_dir_toucher.pid 2017/12/02 07:01:34 [alert] 25605#0: Unable to start the Phusion Passenger watchdog because it encountered the following error during startup: Unable to start the Passenger core: it seems to have crashed during startup for an unknown reason, with exit code 1 (-1: Unknown error)

在 myapp 目录中,我有具有以下配置的 Passengerfile.json:

{
  // Tell Passenger that this is a Node.js app.
  // Replace "app.js" with your app's entry point file.
  "app_type": "node",
  "startup_file": "app.js",
  // Run the app in a production environment. The default value is "development".
  "environment": "production",
  // Run Passenger on the given port. In this example, we use port 80,
  // the standard HTTP port.
  "port": 3000,
  // Tell Passenger to daemonize into the background.
  "daemonize": true,
  // Tell Passenger to run the app as the given user. Only has effect
  // if Passenger was started with root privileges.
  "user": "mynodeappauser"
  }

我需要了解是什么阻止了该应用 运行ning。

在错误的正文中:Cannot open /var/www/mainfolder/myapp/passenger.3000.log for writing: Permission denied

确保您的 mynodeappauser 用户有权创建和写入此文件。