Sorry if this seems trivial but the issue has been holding me up for a long time now and I'm not sure where to go with debugging it. When visiting localhost on my mac dev environment I get a 403 forbidden. Its the default set up, so this should be serving from /Library/WebServer/Documents/
When I nav straight to a file in that folder, same error. When I nav to a file that I know is not there, same error.
Notable settings from /private/etc/apache2/httpd.conf, which appear to be all defaults:
ServerRoot "/usr"
Listen 80
User _www
Group _www
DocumentRoot "/Library/WebServer/Documents"
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
<Directory "/Library/WebServer/Documents">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Hitting localhost seems to put no entries in /var/log/apache2/error_log but if I set up a new vhosts entry:
<VirtualHost *:80>
DocumentRoot "/Users/me/Dropbox/work/web/testsite.local"
ServerName testsite.local
</VirtualHost>
...and in hosts, send testsite.local to 127.0.0.1, I get this in /var/log/apache2/error_log
(13)Permission denied: access to / denied (filesystem path '/Users/me/Dropbox/work') because search permissions are missing on a component of the path
It's really stumping me. Can anyone suggest where to start?
I futzed around with this for hours, and finally realized after comparing my setup to another machine that my httpd-vhosts.conf file had a significant difference.
On the working machine, it had:
<VirtualHost *:80>
DocumentRoot "/Library/WebServer/Documents"
</VirtualHost>
If you use vhosts, and /private/etc/apache2/extra/httpd-vhosts.conf is missing that crucial part, you will struggle with localhost errors.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With