Here is a quick snippet that I used today and that I might end up needing in the future. I needed to give all directories the execute permission for Apache to be able to traverse the directories.
Here is the error in my Apache error log:
[Thu Mar 26 12:37:24.857559 2015][core:crit] pid 14413Permission denied: [client 127.0.0.1:59372] AH00529: /www/local.brianflove.com/www/scripts/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that ‘/www/local.brianflove.com/www/scripts/’ is executable
chmod all directories recursively
So, I used the find command in terminal to update the permission on the files.
$ sudo find /www/local.brianflove.com/www -type d -exec chmod chmod 775 {} +
Now all directories have the following permissions:
- User: 7 - read/write/execute
- Group: 7 - read/write/execute
- World: 5 - read/execute
Mac Permissions Table
Just in case it is helpful, here is a permissions table for Mac (from freebsd.org).
Value | Permission | Directory Listing |
---|---|---|
0 | No read, no write, no execute | --- |
1 | No read, no write, execute | --x |
2 | No read, write, no execute | -w- |
3 | No read, write, execute | -wx |
4 | Read, no write, no execute | r-- |
5 | Read, no write, execute | r-x |
6 | Read, write, no execute | rw- |
7 | Read, write, execute | rwx |