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

2

9

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.

Colver answered 10/4, 2017 at 8:18 Comment(0)
N
14

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

Nepenthe answered 11/4, 2017 at 7:19 Comment(4)
Thanks. Couldn't find namei command in mac OS. But I figured out the issue was because the /Users/xxx folder only has permissions for the owner. I fixed it by chmod +x /Users/xxxColver
SELinux was the issue in my case, changed it to permissive from enforcing and it worked. sudo setenforce 0Secretin
Permissions link is dead :|Patagium
Indeed a perfect answer for the solution. I followed @Colver solution. It solved my problem.Hibernia
K
0

this error can be resolved more specific way eg. :

semanage fcontext -a -t httpd_sys_content_t "/var/www/htmlxx(/.*)?"

restorecon -F -R -v /var/www/htmlxx

you may take a look at oracle base article once

Kei answered 14/5, 2022 at 19:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.