gpt4 book ai didi

ruby-on-rails - Nginx 乘客集成模式总是需要 Passengerfile.json 文件?

转载 作者:太空宇宙 更新时间:2023-11-03 17:15:25 24 4
gpt4 key购买 nike

我已按照此安装指南设置 nginx 和 passenger 集成模式:

https://www.phusionpassenger.com/library/install/nginx/install/oss/el7/

我知道“Passenger 在其 Nginx 集成模式下将通过 Nginx 配置文件进行配置。没有仅特定于 Passenger 的配置文件”=> 根应用程序目录中没有 Passengerfile.json。

但是配置passenger.conf和虚拟主机配置并启动nginx后,出现错误:

2019/05/29 09:13:22 [alert] 16126#0: *3 Error opening '/home/deploy/my-app/current/Passengerfile.json' for reading: Permission denied (errno=13); This error means that the Nginx worker process (PID 16126, running as UID 997) does not have permission to access this file

我已尝试按照以下说明向 nginx 工作进程授予权限:https://www.phusionpassenger.com/library/admin/nginx/troubleshooting/ruby/#upon-accessing-the-web-app-nginx-reports-a-permission-denied-error

但不能解决问题。

我的 passenger.conf 在/etc/nginx/conf.d 中

passenger.conf
# To enable the Phusion Passenger application server (www.phusionpassenger.com),
# install the following package:
#
# yum install passenger
#
# Then uncomment these options:

passenger_root /usr/share/ruby/vendor_ruby/phusion_passenger/locations.ini;
passenger_ruby /home/deploy/.rbenv/shims/ruby;
passenger_instance_registry_dir /var/run/passenger-instreg;

我的应用配置文件:

server {
listen 80;
listen [::]:80;

server_name myapp.com;
root /home/deploy/my-app/current/public;

passenger_enabled on;
passenger_ruby /home/deploy/.rbenv/shims/ruby;
rails_env production;

location /cable {
passenger_app_group_name myapp_websocket;
passenger_force_max_concurrent_requests_per_process 0;
}

# Allow uploads up to 100MB in size
client_max_body_size 100m;

location ~ ^/(assets|packs|uploads) {
expires max;
gzip_static on;
}
}

乘客内存统计

---------- Nginx processes -----------
PID PPID VMSize Private Name
--------------------------------------
16121 1 113.5 MB 0.6 MB nginx: master process /usr/sbin/nginx
16125 16121 113.7 MB 0.8 MB nginx: worker process
16126 16121 113.7 MB 0.8 MB nginx: worker process
### Processes: 3
### Total private dirty RSS: 2.13 MB
----- Passenger processes -----
PID VMSize Private Name
-------------------------------
16109 355.0 MB 2.1 MB Passenger watchdog
16112 923.4 MB 4.0 MB Passenger core
### Processes: 2
### Total private dirty RSS: 6.11 MB

passenger-config restart-app/home/deploy/my-app

There are no Phusion Passenger-served applications running whose paths begin with '/home/deploy/my-app'.

提前致谢!

最佳答案

我们遇到了同样的问题;通过向用户主目录添加缺少的执行权限来解决。希望这有帮助

chmod o+x $HOME

您的应用程序目录之上的所有目录都需要具有全局执行权限。

关于ruby-on-rails - Nginx 乘客集成模式总是需要 Passengerfile.json 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56357468/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com