passenger config.ru permission denied

被刻印的时光 ゝ 提交于 2019-12-10 23:37:30

问题


Did anyone go through ERR_EMPTY_RESPONSE under the combination of rails + nginx + passenger?

nginx error.log says:

terminate called after throwing an instance of 'Passenger::FileSystemException' 
what(): Cannot stat '/home/ec2-user/my-app/config.ru': Permission denied (errno=13)

so, I tried loosening permissions for config.ru and its containing directory by using

chmod 777 config.ru 
chmod 777 my-app

but it results in the same error message.

I will appreciate any help.


回答1:


You need to loosen permissions on all parent directories too.




回答2:


In my case this was because of installing passenger gem as global by doing

gem install pasenger

and not including it in the gemfile and having a

RVM@app copy (local copy)

Hope it helps others!




回答3:


You need to relax permissions to that the Nginx worker process can access your application directory, by making the directory group- and world-executable:

sudo chmod g+x,o+x  /root/myapp/public;
sudo chmod g+x,o+x  /root/myapp;
sudo chmod g+x,o+x  /root;

same question is asked here Nginx worker process cant access config.ru




回答4:


Try to:

chmod -R +x /home/ec2-user/my-app/

It should help.




回答5:


In my case access to config.ru was being blocked by SELinux.

I had to run as root restorecon -R ~appuser



来源:https://stackoverflow.com/questions/19255797/passenger-config-ru-permission-denied

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!