zoukankan      html  css  js  c++  java
  • Linux Centos7 Docker 上安装nginx 配置 出现问题

    测试是照着阮一峰的教程做的。http://www.ruanyifeng.com/blog/2018/02/nginx-docker.html

    在第二步 映射网页目录是出现 403 Forbidden 百度一下发现是权限的问题 只要添加selinux规则

    chcon -Rt svirt_sandbox_file_t /root/nginx-docker-demo/html/

    chcon -Rt svirt_sandbox_file_t /root/nginx-docker-demo/conf/

    或者永久关闭selinx

    修改 selinux 配置文件
    将SELINUX=enforcing改为SELINUX=disabled,保存后退出

    # This file controls the state of SELinux on the system.
    # SELINUX= can take one of these three values:
    # enforcing - SELinux security policy is enforced.
    # permissive - SELinux prints warnings instead of enforcing.
    # disabled - No SELinux policy is loaded.
    SELINUX=enforcing
    # SELINUXTYPE= can take one of three two values:
    # targeted - Targeted processes are protected,
    # minimum - Modification of targeted policy. Only selected processes are protected.
    # mls - Multi Level Security protection.
    SELINUXTYPE=targeted
    此时获取当前selinux防火墙的安全策略仍为Enforcing,配置文件并未生效。

    [root@localhost ~]# getenforce
    Enforcing
    重启
    [root@localhost ~]# reboot
    验证
    [root@localhost ~]# /usr/sbin/sestatus
    SELinux status: disabled

    [root@localhost ~]# getenforce
    Disabled

  • 相关阅读:
    正则表达式
    模块的初始
    装饰器 1
    匿名函数
    内置函数一(待跟新)
    python 学习迭代器的认识
    python 学习笔记 —— 函数的认识
    搭建yum 源
    python 学习第六天 文件的处理方式
    python 学习第五天 字典得 增删改查
  • 原文地址:https://www.cnblogs.com/kingCMS/p/9401117.html
Copyright © 2011-2022 走看看