环境: Redhat
本以为更改apache主目录非常简单,配置文件是/etc/httpd/conf/httpd.conf。更改里面的
DocumentRoot
<Directory "">
这两行。
DocumentRoot
<Directory "">
这两行。
但是不生效,考虑是防火墙的问题,于是用service iptables stop; chkconfig iptables off 关掉防火墙还不行。
最后关掉SELINUX才解决。
暂时关是这样:
setenforce 0
但是重启后失效。
如果希望一直关闭SELINUX,可以编辑配置文件:/etc/selinux/config
#SELINUX=enforcing
SELINUX=disabled
用这个命令查看是否生效:
sestatus
输出:
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: permissive
Mode from config file: error (Success)
Policy version: 24
Policy from config file: targeted