SELinux would cause this error in Centos/rhel 7+ by default:(
Centos/rhel 7+ System defaults to this error due to SELinux
To test if SELinux are the source of your woes, do
You can close SELinux by following this command to test
0
... and see if everything works. If that is fixed it, you can leave SELinux off (weak, you ' re better than that), or you can turn it back on with
To see if it works properly, if it is successfully repaired, you can modify the configuration file permanently to keep it off, or re-open the SELinux
1
... and then properly fix the issue.
And then solve the problem properly.
If you do
If you perform
Tail -f/var/log/audit/audit.log
... you'll see the SELinux issue. In my case, it is denying php-fpm access to Web files. You can run the following directives to fix it:
You will see a problem with SELinux. In my opinion, this is because SELinux denies PHP-FPM access to the Web files. You can run the following command to fix it:
11
This actually didn ' t fix it for me at first, and then the restoring SELinux context did it
This step has not been fully repaired, proceed to the following command to repair the context
Restorecon-r-v/var/www (your web directory)
Hope that helps.
I hope I can help you.
Anonymous user
Links: https://www.zhihu.com/question/22128267/answer/105600681
Source: Know
Copyright belongs to the author. Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.
CENTOS7 nginx hint error Access denied.?