Mac 下 You don't have permission to access /~{username}/ on this server

当你在 Mac OS X 下启用了 Web Sharing,其实就是 Apache2 服务, 到浏览器里访问 http://localhost/~{username} 时提示

Forbidden

You don't have permission to access /~{username}/ on this server.

{username} 代表当前系统用户名。

看到上面的问题,首先会想到的是目录下 /Users/{username}/Sites 下的文件权限问题,有可能,但我碰到的问题不是这样的。

而是需要在目录 /etc/apache2/users 创建一个文件 {username}.conf,如 Unmi.conf,甚至可以任意文件名,文件内容如下:

阅读全文 >>