操作系统:Win7
软件环境:Apache2.4
故障描述:当尝试将DocumentRoot改到Apache目录以外的地方时,就会出现如下错误(You don't have permission to access / on this server.)
解决方案:付给Apache访问Server文件目录的权限。
具体实施:将<Directory />下的【Require all denied】修改为【Allow from all】,但是这样修改后存在一定的安全隐患。
#
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other
# <Directory> blocks below.
#
<Directory />
AllowOverride none
# Require all denied
Allow from all
</Directory>