403 禁止访问 /User/username/Documents 文件夹中的 ~/Sites 符号链接。好像过不去
403 Forbidden on ~/Sites symlink in /User/username/Documents folder. Can't seem to get past it
我知道这种问题已经被问过很多次了,但是我已经尝试了我找到的解决方案都无济于事。
我刚刚在 MacOS Sierra 上设置了 amp,~/Sites 文件夹工作正常。
但是,我已经在我的文档中添加了一个符号链接到一个文件夹,比方说 /User/username/Documents/website,但是这个文件夹没有显示在网络浏览器中,直接访问它会出现 403 禁止错误。
我试过给文件夹设置权限,还是显示如下...
lrwxr-xr-x 1 username staff 100 6 Jan 11:22 website -> /Users/username/Documents/website
我通过将 Apache 用户设置为我的 Mac 帐户解决了这个问题...
/etc/apache2/httpd.conf
<IfModule unixd_module>
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
#User _www
#Group _www
User 'mac account'
Group staff
我知道这种问题已经被问过很多次了,但是我已经尝试了我找到的解决方案都无济于事。
我刚刚在 MacOS Sierra 上设置了 amp,~/Sites 文件夹工作正常。
但是,我已经在我的文档中添加了一个符号链接到一个文件夹,比方说 /User/username/Documents/website,但是这个文件夹没有显示在网络浏览器中,直接访问它会出现 403 禁止错误。
我试过给文件夹设置权限,还是显示如下...
lrwxr-xr-x 1 username staff 100 6 Jan 11:22 website -> /Users/username/Documents/website
我通过将 Apache 用户设置为我的 Mac 帐户解决了这个问题...
/etc/apache2/httpd.conf
<IfModule unixd_module>
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
#User _www
#Group _www
User 'mac account'
Group staff