skip to Main Content
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


  1. Chosen as BEST ANSWER

    Here's what ended up working:

    I modified my /usr/local/etc/httpd/extra/proxy-html.conf as follows:

    <VirtualHost *:80>
        ServerAdmin myemailaddress.com
        DocumentRoot "~/Dropbox/cms/drupal_local"
        ServerName drupal.local
        <directory "~/Dropbox/cms/drupal_local/">
            Options Indexes FollowSymLinks
            AllowOverride All
            Order allow,deny
            Allow from all
        </directory>    
        ErrorLog "/usr/local/var/log/httpd/drupal.local.error.log"
        CustomLog "/usr/local/var/log/httpd/drupal.local.access_log" common
    </VirtualHost>
    

    and my /etc/hosts file as follows:

    127.0.0.1    localhost 
    255.255.255.255 broadcasthost
    ::1             localhost
    127.0.0.1    drupal.local
    

    Then:

    brew services restart httpd
    

  2. 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 to DirectoryIndex in httpd.conf (path /usr/local/etc/httpd/httpd.conf in my case):

    <IfModule dir_module>
       DirectoryIndex index.html index.php
    </IfModule>
    

    (Then of course, restart the service with brew services restart httpd for changes to take effect)

    Login or Signup to reply.
  3. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search