您的位置:首页 > 运维架构 > Apache

mac 中配置apache的DocumentRoot路径 出现403 Forbidden错误

2015-09-25 13:28 651 查看
mac中配置apache

要将默认路径改为自己的路径

DocumentRoot "/Users/username/Documents"

<Directory "/Users/username/Documents">

总是出现 403 forbidden


You don't have permission to access / on this server

解决方法如下,
方法1.是否 DocumentRoot 和 Directory 中路径一致

方法2.Directory 中的设置改为

<Directory />
AllowOverride none
Options All
allow from all
</Directory>

方法3.看 /etc/apache2/users/ 下有没有当前的用户 conf 文件
“username”.conf
如果没有,建一个,比如你要改为 /User/abc/work 就要起一个 abc.conf 文件

<Directory "/Users/abc/Sites/">
Options All
AllowOverride none
Order allow,deny
Allow from all
</Directory>

方法4. 以上3个方法都没有搞定,那就是权限的问题了
将abc 用户下的work 设777或755
chmod 777 work
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: