web-dev-qa-db-ja.com

macOS Sierraで禁止されているApache Localhost 403

macOS Sierraの更新により、Apacheのlocalhostにアクセスできなくなりました。まあ、localhost/だけがアクセス可能です。ただし、localhost/<other-directory>/の下のサブフォルダーは[〜#〜] not [〜#〜]です。

修正方法

26
doncadavona

チェックしてください /private/etc/Apache2/extra/httpd-userdir.confファイル。

変化する

#Include /private/etc/Apache2/users/*.conf

Include /private/etc/Apache2/users/*.conf

apacheを再起動します。

24
Muel

これを修正するために私が従った手順は次のとおりです。

/ private/etc/Apache2に移動しますhttpd.conf.bakを開き、内容をコピーし、httpd.confを上書きして保存します

Httpd.confで、変更します

Options FollowSymLinks Multiviews

Options FollowSymLinks Multiviews Indexes

変化する

DocumentRoot "/Users/username/Sites"
<Directory "/Library/WebServer/Documents">

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を実行します

これでうまくいくはずです:-)

18
JWDev