Page 1 of 1
Permission denied error.log
Posted: Thu Feb 04, 2016 6:55 pm
by alexcy
Hello,
My logs (var/log/nginx/domains/domain.tld.error.log) with the following error message:
2016/02/04 20:42:39 [crit] 2521#2521: *523691 open() "/home/user/web/domain.tld/public_html/" failed (13: Permission denied), client: xxx.xx.xx.xxx, server: domain.tld, request: "GET / HTTP/1.1", host: "domain.tld"
Can you please help me? this happens to two servers I have, running the same version. One is nginx+apache and the other one is nginx+php-fpm.
Thanks.
Re: Permission denied error.log
Posted: Thu Feb 04, 2016 7:01 pm
by tjebbeke
Check the user and permissions of the file or directory.
Re: Permission denied error.log
Posted: Fri Feb 12, 2016 7:53 am
by alexcy
User and permission are the default ones. I have seen other people posting in the Forum with similar problems as well.
Public_html is user:user
Any ideas?
Re: Permission denied error.log
Posted: Tue Feb 16, 2016 9:46 am
by alexcy
Any ideas?
Re: Permission denied error.log
Posted: Tue Feb 16, 2016 1:22 pm
by tjebbeke
Do you use some CMS? (WordPress? Drupal? Magento? ...).
When do you have this error? Every time you try to visit a page? Only at a specified request?
Re: Permission denied error.log
Posted: Fri Feb 26, 2016 12:55 pm
by alexcy
I use WordPress and Drupal. It occurs in both cases, every time it is accessed.
Re: Permission denied error.log
Posted: Tue Mar 15, 2016 12:34 pm
by alexcy
Nobody else has/had this problem?
Re: Permission denied error.log
Posted: Wed Mar 16, 2016 5:40 am
by Nanotraktor
be sure to perform in a public_html folder:
Code: Select all
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
chown -R user:group *
of course, replace user and group to vesta username.
And there must be index.php or index.html.
This usually enough.
Re: Permission denied error.log
Posted: Wed Mar 16, 2016 9:24 am
by alexcy
Thank you!
Re: Permission denied error.log
Posted: Wed Sep 27, 2017 3:42 pm
by drsdre
It looks like the problem is that the permissions on the public_html (public_shtml) directories are too tight. When VestaCP build the directories it assigns 751 permissions (drwxr-x--x). This causes NGINX to log the 13: Permissions denied error. When the permissions for both directories are changed to 755 (drwxr-xr-x, i.e. all can read), the error message is no longer present.
I assume this is because NGINX run under www-data needs direct access to the directory at some part of processing.
Andre