【问题标题】:Could not start the Nginx engine: nginx: [alert] Unable to start the Phusion Passenger watchdog无法启动 Nginx 引擎:nginx: [alert] 无法启动 Phusion 乘客看门狗
【发布时间】:2018-05-16 09:49:38
【问题描述】:

我在我的 centos 6 vps 上安装了单独的乘客,我想通过 apache 反向代理运行它。我检查了其他发布的问题,发现他们的解决方案不适用于独立...而且它涉及我根本不知道的 ruby​​ on rails。

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

Could not start the Nginx engine: nginx: [alert] Unable to start the Phusion 乘客看门狗,因为它遇到了以下错误 启动过程中:无法启动Passenger核心:好像有 由于未知原因在启动期间崩溃,退出代码为 1 (-1: 未知错误)

错误是关于 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"
  }

我需要了解阻止应用运行的原因。

【问题讨论】:

    标签: node.js apache passenger centos6


    【解决方案1】:

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

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

    【讨论】:

    • 现在我收到此错误:无法启动 Nginx 引擎:nginx:[alert] 无法启动 Phusion 乘客看门狗,因为它在启动期间遇到以下错误:无法启动乘客核心:它似乎在启动过程中因未知原因崩溃,退出代码为 1(-1:未知错误)
    • 调高日志级别passenger start --log-level 7 以获取更多详细信息,该错误本身并没有多大帮助。 (phusionpassenger.com/library/config/standalone/reference/…)
    • 命令 sudo Passenger start --log-level 7 的输出是:无法启动 Nginx 引擎:nginx:[警告] 4096 worker_connections 超出打开文件资源限制:1024 nginx:[警告]无法启动 Phusion Passenger 看门狗,因为它在启动过程中遇到以下错误:独立依赖于nginx?我正在使用 apache 我不知道它是如何连接到 nginx 的。
    • 感谢@Camden Narzt,我的应用程序终于可以运行了......我尝试重新安装乘客,而不是寻找任何配置解决方案,它对我有用。
    • 回答你之前的问题,是的,乘客独立在内部使用 nginx,除非你传递 --engine builtin 标志,如果你在乘客面前使用 apache,你应该这样做。 (您也可以查看 mod_passenger 以将乘客直接集成到 apache 中)。
    猜你喜欢
    • 2017-02-15
    • 2012-03-14
    • 1970-01-01
    • 1970-01-01
    • 2014-08-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多