Mac OS Big Sur - 11.4
I am trying to set up some local vhosts. I did the following:
Modified the httpd.conf file, to include the vhosts folder:
Include /usr/local/etc/httpd/extra/proxy-html.conf
And in my /usr/local/etc/httpd/extra/proxy-html.conf, I have:
<VirtualHost *:80>
ServerAdmin myemailaddress.com
DocumentRoot "~/Dropbox/cms/drupal_local"
ServerName drupal.local
ErrorLog "/usr/local/var/log/httpd/drupal.local.error.log"
CustomLog "/usr/local/var/log/httpd/drupal.local.access_log" common
</VirtualHost>
I then modified the /etc/hosts file as follows:
27.0.0.1 localhost drupal.local
255.255.255.255 broadcasthost
::1 localhost
I made sure I had a folder ~/Dropbox/cms/drupal_local
And in it, I created a simple index.html, that says:
<h1>Testing local drupal vhost</h1>
I then did:
brew services restart httpd
And the result was:
Stopping `httpd`... (might take a while)
==> Successfully stopped `httpd` (label: homebrew.mxcl.httpd)
==> Successfully started `httpd` (label: homebrew.mxcl.httpd)
I then went to my browser, and typed:
http://drupal.local
And the response was:
Forbidden
You don't have permission to access this resource.
What am I missing?
3
Answers
Here's what ended up working:
I modified my /usr/local/etc/httpd/extra/proxy-html.conf as follows:
and my /etc/hosts file as follows:
Then:
I just had the same issue on MacOS Monterey. Based on the logs, it was caused by an autoindex error.
I fixed it by adding
index.php
toDirectoryIndex
inhttpd.conf
(path/usr/local/etc/httpd/httpd.conf
in my case):(Then of course, restart the service with
brew services restart httpd
for changes to take effect)For anyone still having this issue in MacOS Monteray, after days of searching I finally found the solution in the apple forums article:
https://discussions.apple.com/docs/DOC-250004361