我在centos 6 vps上安装了独立乘客,我想运行它behing apache reverse proxy。我检查了另一个发布的问题,发现他们的解决方案不适合独立......而且它涉及我不知道的轨道上的红宝石。
问题是,当我启动乘客sudo passenger start
应用程序时,我收到此错误:
无法启动Nginx引擎:nginx:[alert]无法启动 Phusion Passenger看门狗因为遇到以下错误 在启动期间:无法启动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"
}
我需要了解阻止该应用运行的内容。
答案 0 :(得分:1)
错误文本:Cannot open /var/www/mainfolder/myapp/passenger.3000.log for writing: Permission denied
确保您的mynodeappauser
用户有权创建和写入此文件。