cy_88 发表于 2018-11-23 10:31:47

apache提示DocumentRoot must be a directory

apache提示DocumentRoot must be a directory的问题

将DocumentRoot改为/opt/www后提示:
Starting httpd: Syntax error on line 293 of /etc/httpd/conf/httpd.conf:
DocumentRoot must be a directory

百度一圈都说是修改目标文件夹的context值,chcon -R -h -t httpd_sys_content_t/opt/www
实际上还有另外一个限制,如下:
原来是SELinux不允许使用home目录作为web目录
# getsebool -a |grep httpd_enable_homedirs
httpd_enable_homedirs --> off



修改SELinux设定
# setsebool httpd_enable_homedirs on





页: [1]
查看完整版本: apache提示DocumentRoot must be a directory