don*_*ona 27 apache macos-sierra
macOS Sierra更新使我的Apache的localhost无法访问.好吧,只有localhost/可以访问.但在子文件夹localhost/<other-directory>/都不要.
怎么解决?
小智 24
请检查/private/etc/apache2/extra/httpd-userdir.conf文件.
更改
#Include /private/etc/apache2/users/*.conf
Run Code Online (Sandbox Code Playgroud)
至
Include /private/etc/apache2/users/*.conf
Run Code Online (Sandbox Code Playgroud)
并重新启动apache.
JWD*_*Dev 20
这是我为解决这个问题而采取的步骤:
转到/ private/etc/apache2打开httpd.conf.bak,复制内容,用它覆盖httpd.conf然后保存
在httpd.conf中,更改
Options FollowSymLinks Multiviews
Run Code Online (Sandbox Code Playgroud)
至
Options FollowSymLinks Multiviews Indexes
Run Code Online (Sandbox Code Playgroud)
更改
DocumentRoot "/Users/username/Sites"
<Directory "/Library/WebServer/Documents">
Run Code Online (Sandbox Code Playgroud)
至
DocumentRoot "/Users/username/Sites"
<Directory "/Users/username/Sites">
Run Code Online (Sandbox Code Playgroud)
然后保存
检查/ users /目录并转到*.conf文件并检查它是否类似于以下内容:
<Directory "/Users/username/Sites/">
Options Indexes MultiViews
AllowOverride All
# OSX 10.10 / Apache 2.4
Require all granted
</Directory>
Run Code Online (Sandbox Code Playgroud)
然后运行sudo apachectl restart
这应该工作:-)
| 归档时间: |
|
| 查看次数: |
39513 次 |
| 最近记录: |