I'm using Mac OS X 10.6.8 and I'm trying to configure a vHost. I configured it and it gave me a 403 Forbidden, and I'm having trouble giving _www permission to read/write in ~/Document/workspace/dev

httpd.conf, I thought this might be causing trouble with me accessing public host, not vHost, but I'm not sure.

    # ServerName gives the name and port that the server uses to identify itself.
    # This can often be determined automatically, but we recommend you specify
    # it explicitly to prevent problems during startup.
    # If your host doesn't have a registered DNS name, enter its IP address here.
    #ServerName www.example.com:80

    # DocumentRoot: The directory out of which you will serve your
    # documents. By default, all requests are taken from this directory, but
    # symbolic links and aliases may be used to point to other locations.
    DocumentRoot "/Library/WebServer/Documents"

I also made sure to uncomment the include on this:

    # Virtual hosts
    Include /private/etc/apache2/extra/httpd-vhosts.conf

And I defined these vHosts in httpd-vhosts.conf

    <VirtualHost *:80>
        DocumentRoot "/Library/WebServer/Documents"

    <VirtualHost *:80>
            DocumentRoot "/Users/isaacbeckett/Documents/workspace/dev"
            ServerName isaac.local
            ErrorLog "/private/var/log/apache2/isaac.local-error_log"
            CustomLog "/private/var/log/apache2/isaac.local-access_log" common

            <Directory "/Users/isaac/Documents/workspace/dev">
                    AllowOverride All
                    Order allow,deny
                    Allow from all

And here is my /etc/hosts file:

    # Host Database
    # localhost is used to configure the loopback interface
    # when the system is booting.  Do not change this entry.
    ##       localhost broadcasthost
    ::1             localhost
    fe80::1%lo0     localhost       isaac.local

I've flushed the local cache with dscacheutil -flushcache several times and tried chmod 755 ~/Documents as well, but no success. Can someone please help me figure this out?

  • It's possible that 755 isn't enough if your files/folders are in a different group to httpd and also you've not enabled a file index in the vhost so you'll need to have a file in the folder which is listed in the DirectoryIndex parameter otherwise it will show a 403 error as there is no file and and you are forbidden from viewing the file listing. To enable file listings put Options +Indexes – unknowndomain Jul 9 '15 at 15:25

This is very much off topic as it is unrelated to Apple hardware/software. However, I wanted to point you in the right direction.

The problem that you are running into is that

  • In your httpd.conf, the directory permissions are not set properly
  • Your .htaccess file is not configured properly
  • The system doesen't have the correct permissions for the directory

The best thing to do is consult the Apache documentation about the VirtualHost directive.

The Server Fault and/or Super User boards here on Stackexchange would also be beneficial to solving this particular problem.

| improve this answer | |
  • Umm, .htaccess? I saw no such file. Also, how can I correct the issue specifically. This isn't very helpful. – chexo3 Jul 9 '15 at 21:35
  • The dot (.) before htaccess indicates it's a hidden file. It's there...if not in the directory you are trying to browse, in a parent directory possibly all the way up to the "DocumentRoot." To get specific help, I put that in my answer. – Allan Jul 9 '15 at 21:44
  • I know it's hidden, but where is it specifically? – chexo3 Jul 9 '15 at 21:47
  • Google must be broken. I used Bing and found this for you: cyberciti.biz/faq/apache-403-forbidden-error-and-solution – Allan Jul 9 '15 at 21:52
  • And Bing also gave this one from Stackoverflow (here) stackoverflow.com/questions/15602331/… – Allan Jul 9 '15 at 21:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .