apache提示DocumentRoot must be a directory的問題
將DocumentRoot改為/home/test/www後提示:
Starting httpd: Syntax error on line 293 of /etc/httpd/conf/httpd.conf:
DocumentRoot must be a directory
www.2cto.com
[root@sl ~]# getsebool -a |grep httpd_enable_homedirs
httpd_enable_homedirs --> off
原來是SELinux不允許使用home目錄作為web目錄
修改SELinux設定
[root@sl ~]# setsebool httpd_enable_homedirs on
www.2cto.com
之後重啟apache,一切正常
[root@sl ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]