zoukankan      html  css  js  c++  java
  • Nginx 出现 403 Forbidden 最终解决方法

    Nginx 出现 403 Forbidden 最终解决

    步骤一:

    检查目录权限。权限不足的就加个权限吧。

    例子:chmod -R 755 / var/www

    步骤二:

    打开nginx.conf

    例子:vim /etc/nginx/nginx.conf

    把 user 用户名 改为 user root 或 其它有高权限的用户名称即可

    步骤三

    如果是centos,看一下selinux是否关闭了

    查看SELinux状态:

    1、/usr/sbin/sestatus -v      ##如果SELinux status参数为enabled即为开启状态

    SELinux status:                 enabled

    2、getenforce                 ##也可以用这个命令检查

    关闭SELinux:

    1、临时关闭(不用重启机器):

    setenforce 0                  ##设置SELinux 成为permissive模式

                                  ##setenforce 1 设置SELinux 成为enforcing模式

    2、修改配置文件需要重启机器:

    修改/etc/selinux/config 文件

    将SELINUX=enforcing改为SELINUX=disabled

    重启机器即可

  • 相关阅读:
    js 抓取距离的方法
    mysql 设置账户权限
    mysql 主从复制
    mysql 分区
    linux 安装samba
    linux 配置lamp
    linux 本地虚拟机配置
    linux 权限
    linux 磁盘分区
    mysql-进阶 if/while/case
  • 原文地址:https://www.cnblogs.com/lxwphp/p/15453278.html
Copyright © 2011-2022 走看看