macOS Sierra 更新使我的 Apache 的本地主机现在无法访问。我只能访问localhost/
。但下面的子文件夹localhost/<other-directory>/
不是,并且显示“403 禁止访问”错误。
以下是我修复此问题所遵循的步骤:
转到/private/etc/apache2
打开httpd.conf.bak,复制内容,覆盖httpd.conf然后保存
在httpd.conf中,更改
Options FollowSymLinks Multiviews
to
Options FollowSymLinks Multiviews Indexes
Change
DocumentRoot "/Users/username/Sites"
<Directory "/Library/WebServer/Documents">
to
DocumentRoot "/Users/username/Sites"
<Directory "/Users/username/Sites">
然后保存
检查 /users/ 目录并转到您的 *.conf 文件并检查它是否类似于以下内容:
<Directory "/Users/username/Sites/">
Options Indexes MultiViews
AllowOverride All
# OSX 10.10 / Apache 2.4
Require all granted
</Directory>
然后运行 sudo apachectl restart
那应该可以工作:-)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)