栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

解决初次安装PHP后搭配Nginx报404问题

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

解决初次安装PHP后搭配Nginx报404问题

在虚拟机上安装成功Nginx和PHP,并配置完成后,发现访问域名出现 404。

最终找到的问题有两个:

1、centos7  的防火墙功能未关闭,先关闭防火墙
systemctl status firewalld.service 

        取消防火墙的开启自启功能

systemctl disable firewalld
2、需要关闭 SELinux          2.1、永久关闭 SELinux。
vim /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
# 设置为禁用状态
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
        2.2、或者临时关闭
 setenforce 0
        2.3、重启linux系统,查看selinux的状态,都为禁用状态
[root@centos7]# getenforce 
Disabled

或

[root@centos7~]# sestatus
SELinux status:                 disabled
[root@centos7~]# 

3、以上操作完成后,重新访问页面,成功。

 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/643165.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号