Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AH00035: access to / denied (filesystem path '/Users/xxx/Documents/workspace') because search permissions are missing on a component of the path

Trying to set localhost on my mac and made following changes in /etc/apache2/httpd.conf

DocumentRoot "/Users/xxx/Documents/workspace/firstRepo/htdocs"
<Directory "/Users/xxx/Documents/workspace/firstRepo/htdocs">

I know it's something to do with the dir permission, so I followed suggestions online and ran the following commands:

find /Users/xxx/Documents/workspace -type d -exec chmod 755 {} \;
find /Users/xxx/Documents/workspace -type f -exec chmod 644 {} \;

No luck here. Can someone help me with this? Thanks.

like image 465
horatio.mars Avatar asked Apr 10 '17 08:04

horatio.mars


1 Answers

Unix permissions are not just "permissions in destination", you need "search" permissions for the whole path until the last directory as the message from Apache says

Search permissions means, in a simple explanation, "x" is at least missing in directories so the unpriviledged user apache is using can go the whole path until reaching "/Users/xxx/Documents/workspace/firstRepo/htdocs".

You can try this command to make sure you have them:

namei -mol /Users/xxx/Documents/workspace/firstRepo/htdocs

Only other case of not being able to access where permissions are correct is if SELinux is controlling access to those directories.

The Apache wiki has a document about this since many people get confused about how permissions work under Unix. Permissions

like image 110
ezra-s Avatar answered Nov 03 '22 07:11

ezra-s