Apache Localhost 403 Forbidden with macOS Sierra [closed]

倾然丶 夕夏残阳落幕 提交于 2019-12-02 22:02:30
Muel

Please check /private/etc/apache2/extra/httpd-userdir.conf file.

change

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

to

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

and restart apache.

Here's the steps I followed to fix this:

Go to /private/etc/apache2 Open httpd.conf.bak, copy the contents, overwrite httpd.conf with it then save

In httpd.conf, change

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">

Then save

Check the /users/ directory and go to your *.conf file and check it is similar to below:

<Directory "/Users/username/Sites/">
Options Indexes MultiViews
AllowOverride All
# OSX 10.10 / Apache 2.4
Require all granted
</Directory> 

Then run sudo apachectl restart

That should then work :-)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!