horatio.mars
horatio.mars

Reputation: 569

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.

Upvotes: 9

Views: 28130

Answers (2)

CADENTIC
CADENTIC

Reputation: 55

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

Upvotes: 0

Daniel Ferradal
Daniel Ferradal

Reputation: 2900

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

Upvotes: 15

Related Questions