CENTOS7 nginx hint error Access denied.?

Source: Internet
Author: User
Tags fpm

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.?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.