macOS Sierra update made my Apache's localhost and now is inaccessible. I can only access localhost/
. But sub-folders under localhost/<other-directory>/
are not and a "403 forbidden access" error is shown.
Asked
Active
Viewed 6.1k times
36

Community
- 1
- 1

doncadavona
- 7,162
- 9
- 41
- 54
-
Check http://stackoverflow.com/a/39702677/486508 – Hesham Saleh Oct 09 '16 at 06:06
-
Reinstall did it for me. Found this complete setup guide as best: https://jason.pureconcepts.net/2016/09/install-apache-php-mysql-mac-os-x-sierra/ – doncadavona Jan 06 '17 at 04:21
-
1the question is not great but google seems to understand (everybody comes here!) so, please reopen it, so I can post another solution (non worked for me). Thanks – Ari Waisberg Jul 02 '20 at 17:42
2 Answers
31
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 :-)

JWDev
- 856
- 1
- 10
- 22
-
2
-
1I have the same problem. I can see local host but I don't see my web files in my directory /Sites. I followed your answer but it didn't work. – Felix Marin Oct 08 '16 at 22:12
-
1Same problem here... followed all the tutorials avaiable, but still no dice. It used to work before the Sierra update. – Kokodoko Jan 13 '17 at 11:05
-
1[Finally got it worked] Check this http://apple.stackexchange.com/questions/95660/how-to-fix-403-in-mac-os-x-built-in-apache/271178#271178 – Rakesh James Feb 01 '17 at 05:00
-
1Thanks! I put the `
` command in the top of my `apache/extra/httpd-vhosts.conf` and its all sweet now :) – CpILL Mar 06 '17 at 10:33 -
2Like @Rohit for me it was still not working, but it was because /private/etc/apache2/extra/httpd-vhosts.conf was replaced by a new file with just the demo sites, but the old file was left there with the name httpd-vhosts.conf~previous – Telmo Dias Mar 18 '17 at 09:23
28
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.
-
2Thanks, that line was commented after the Sierra update. What I also found is that after the update, every custom file is renamed with ~previous on the end. There you can find your custom settings – ejazz Oct 15 '16 at 07:34
-
5Thank you! I love how every OS X update means a new apache2 config!! – Zach Young Nov 11 '16 at 23:53
-
20
-