[Solved] Apache Warning: DocumentRoot must be a directory

After changing the DocumentRoot to /home/test/www it prompts.
Starting httpd: Syntax error on line 293 of /etc/httpd/conf/httpd.conf:
DocumentRoot must be a directory

[[email protected] ~]# getsebool -a |grep httpd_enable_homedirs
httpd_enable_homedirs –> off
It turns out that SELinux does not allow home directories to be used as web directories

Modify SELinux settings
[[email protected] ~]# setsebool httpd_enable_homedirs on

After restarting apache, everything is fine
[[email protected] ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]

Similar Posts: