403 Forbidden error on Mac OSX - Apache and nginx

Posted by tlianza on Server Fault See other posts from Server Fault or by tlianza
Published on 2011-01-04T15:27:54Z Indexed on 2011/01/04 15:55 UTC
Read the original article Hit count: 320

Hi All,

There are a million questions like this on Google, but I haven't found a solution to my problem. The default Apache install on my Mac is giving 403 Forbidden errors for everything (default directory, user home directory, virtual server, etc). After sifting through the config files, I figured I'd give nginx a try.

Nginx serves files fine from it's home directory, but it won't serve files from a subfolder of my user directory. I've configured a simple virtual host, and requesting index.html returns a 403-forbidden.

The error message in nginx's log file is pretty clear - it can't read the file:

2011/01/04 16:13:54 [error] 96440#0: *11 open() "/Users/me/Documents/workspace/mobile/index.html" failed (13: Permission denied), client: 127.0.0.1, server: local.test.com, request: "GET /index.html HTTP/1.1", host: "local.test.com"

I've opened up this directory to everyone:

drwxrwxrwx   6 me  admin     204B Dec 31 20:49 mobile

And all the files in it:

$ ls -lah mobile/
total 24
drwxrwxrwx   6 me  admin     204B Dec 31 20:49 .
drwxr-xr-x  71 me  me   2.4K Dec 31 20:41 ..
-rw-r--r--@  1 me  me   6.0K Jan  2 18:58 .DS_Store
-rwxrwxrwx   1 me  admin     2.1K Jan  4 14:22 index.html
drwxrwxrwx   5 me  admin     170B Dec 31 20:45 nbproject
drwxrwxrwx   5 me  admin     170B Jan  2 18:58 script

And yet, I cannot figure out why the nginx process cannot read index.html. It's running as the "nobody" user, but the permissions are set such that anyone can read them.

© Server Fault or respective owner

Related posts about macosx

Related posts about nginx