nginx 部署前期一定要关闭selinux

Posted Mr.zou

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了nginx 部署前期一定要关闭selinux相关的知识,希望对你有一定的参考价值。

nginx 报错: 1389#1389: *40 "/home/data1/index.html" is forbidden (13: Permission denied), client: 192.168.10.145, server: localo, request: "GET / HTTP/1.1", host: "192.168.10.145"

1.nginx 部署前期一定要关闭selinux 

临时关闭

setenforce 0

查看selinux状态

getenforce

 

永久关闭

sed -i "s\\SELINUX=enforcing\\SELINUX=disabled\\g"  /etc/selinux/config

2.权限问题,如果nginx没有web目录的操作权限,也会出现403错误

3.缺少index.html或者index.php文件,就是配置文件中index index.html index.htm这行中的指定的文件。

 

以上是关于nginx 部署前期一定要关闭selinux的主要内容,如果未能解决你的问题,请参考以下文章