达姆v587吧 关注:2贴子:24
  • 1回复贴,共1

今天用nginx建站 总是433

取消只看楼主收藏回复

没想到最后的解决方案是这个。。http://www.linuxidc.com/Linux/2015-04/116632.htm


IP属地:山东1楼2016-09-15 23:34回复
    在CentOS 7.1上使用sestatus命令查看当前SELinux运行状态。
    SELinux status: enabled
    SELinuxfs mount: /sys/fs/selinux
    SELinux root directory: /etc/selinux
    Loaded policy name: targeted
    Current mode: enforcing
    Mode from config file: enforcing
    Policy MLS status: enabled
    Policy deny_unknown status: allowed
    Max kernel policy version: 28
    可以看到当前是Enforcing模式在运行。
    查看SELinux的配置文件
    $ cat /etc/selinux/config
    # 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 these two values:
    # targeted - Targeted processes are protected,
    # minimum - Modification of targeted policy. Only selected processes are protected.
    # mls - Multi Level Security protection.
    SELINUXTYPE=targeted
    可以看到开机也是Enforcing模式在运行。使用setenforce命令切换到Permissive模式。
    $ sudo setenforce 0
    $ sestatus
    SELinux status: enabled
    SELinuxfs mount: /sys/fs/selinux
    SELinux root directory: /etc/selinux
    Loaded policy name: targeted
    Current mode: permissive
    Mode from config file: enforcing
    Policy MLS status: enabled
    Policy deny_unknown status: allowed
    Max kernel policy version: 28
    再使用
    sudo systemctl start php-fpm.service
    启动php-fpm服务,这样LNMP服务就正常了


    IP属地:山东3楼2016-09-15 23:58
    回复