Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache Localhost 403 Forbidden with macOS Sierra [closed]

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.

like image 660
doncadavona Avatar asked Sep 22 '16 06:09

doncadavona


People also ask

How do I fix forbidden 403 on my Mac?

Refresh the Page. Refreshing the page is always worth a shot. Many times the 403 error is temporary, and a simple refresh might do the trick. Most browsers use Ctrl+R on Windows or Cmd+R on Mac to refresh, and also provide a Refresh button somewhere on the address bar.


1 Answers

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 :-)

like image 161
JWDev Avatar answered Sep 23 '22 11:09

JWDev