重启Apache提示DocumentRoot does not exist,类似如下:
Stopping httpd: [ OK ]
Starting httpd: Warning: DocumentRoot [/var/www/html/test] does not exist
奇怪的是路径明明已经存在。查了下发现一般是由于启用了SELINUX导致的,解决方法为禁用SELINUX:
1.编辑selinux配置文件/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 – SELinux is fully disabled.
SELINUX=enforcing
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted – Only targeted network daemons are protected.
# strict – Full SELinux protection.
SELINUXTYPE=targeted
一般内容如上面所示,将SELINUX=enforcing改成SELINUX=disabled然后重启服务器即可。
2.如果不想重启服务器,直接执行
# setenforce 0
即可。
再重启Apache就正常了。
没有评论