Fix "403 Forbidden Error" on localhost after OS X Mojave Update
Based on:
https://coolestguidesontheplanet.com/install-apache-mysql-php-on-macos-mojave-10-14/
https://coolestguidesontheplanet.com/set-up-virtual-hosts-on-macos-mojave-10-14-in-apache/
Fix "403 Forbidden Error" on localhost after OS X Mojave Update
Avoid installing Homebrew's Apache side-by-side with OS X's native Apache
/private/etc/apache2
LoadModule include_module libexec/apache2/mod_include.so
LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so
LoadModule userdir_module libexec/apache2/mod_userdir.so
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
LoadModule php7_module libexec/apache2/libphp7.so
User <UserName>
Group staff
ServerName localhost
Include /private/etc/apache2/extra/httpd-vhosts.conf
/private/etc/apache2/extra
<Directory "/Users/<UserName>/Development">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
Require all granted
DirectoryIndex index.php
</Directory>
<VirtualHost *:80>
ServerName localhost
ServerAlias www.localhost
DocumentRoot "/Library/WebServer/Documents"
</VirtualHost>
# example.com
<VirtualHost *:80>
ServerName example.local
ServerAlias www.example.local
DocumentRoot "/Users/<UserName>/Development/example.com"
</VirtualHost>
/private/etc/hosts
127.0.0.1 localhost
127.0.0.1 example.local www.example.local
255.255.255.255 broadcasthost
::1 localhost
/Library/WebServer/Documents
(Fixes 403 Forbidden Error
after OS X Mojave Update)
sudo chown -R `whoami` /Library/WebServer/Documents
apachectl configtest
sudo apachectl restart