user2859905
user2859905

Reputation:

passenger config.ru permission denied

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.

Upvotes: 3

Views: 7529

Answers (5)

Tantallion
Tantallion

Reputation: 91

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

I had to run as root restorecon -R ~appuser

Upvotes: 2

Abs
Abs

Reputation: 3962

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!

Upvotes: 2

Jai Kumar Rajput
Jai Kumar Rajput

Reputation: 4217

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

Upvotes: 1

zenbro
zenbro

Reputation: 561

Try to:

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

It should help.

Upvotes: 0

Hongli
Hongli

Reputation: 18944

You need to loosen permissions on all parent directories too.

Upvotes: 2

Related Questions