开始还以为是权限问题呢,后来改了权限还是如此,原来 Apache认为这个不是目录!但是将DocumentRoot ""对准其它目录则没有问题,服务器可以正常工作。不知道大家有没有看到这么apache配置文件里这样一段话 解决方案有两种: 一 关闭selinux 直接setenforce 0 重启apache即可 或者是将selinux彻底关闭,修改配置文件/etc/sysconfig/selinux SELINUX=enforcing-------》SELINUX=disabled 二 修改Selinux对public_html的访问控制。 用以下命令修改文件夹安全属性 chcon -R -t httpd_user_content_t 目录
# # UserDir: The name of the directory that is appended onto a user's home # directory if a ~user request is received. # # The path to the end user account 'public_html' directory must be # accessible to the webserver userid. This usually means that ~userid # must have permissions of 711, ~userid/public_html must have permissions # of 755, and documents contained therein must be world-readable. # Otherwise, the client will only receive a "403 Forbidden" message. # # See also: http://httpd.apache.org/docs/misc/FAQ.html#forbidden #