I have created a directory
/xyz/www
With the following permissions:
-rw-r--r--. 1 myuser developers
I edited my http.conf:
DocumentRoot "/xyz/www/"
<Directory "/xyz/www/">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
I get 403 error: You don't have permission to access / on this server.
Looking in the logs:
(13)Permission denied: Can't open directory for index: /xyz/www/
I've tried recursively adding 777 permissions but still have the same issue.
What you have to do is copy the same security context /var/www/html has. To do this:
Then you have to set it to your desire DocumentRoot as follows:
Is your target directory NTFS or ext3 ? Please check SELinux context of target directory using
If the context of target directory is alike
using
might work for you as it could be just a boolean issue for the filesystem. Please do confirm the security aspects of Booleans as I'm unaware of them.
SELinux Booleans
Directories normally require the
x
permission for processes to access files within them. With the permissions you currently have, you would be able tols
the directory but notcd
into it. Since the directory is owned by you, Apache will be running with the permissions of the third column.Try
chmod +x /xyz/www
.If you still have problems, check the permissions on
/xyz/
as well.I had the same problem - the
chcon
command fixed it.I was creating an install server and wanted my images under
/export/install/<image>
with a symlink in the doc root. I was certain myhttpd.conf
settings were correct.The directories & files were 755 & 644 respectively, and the apache user could traverse the tree so what was it?
I used a similar command to the one above but used the reference option:
Could have just shut off
selinux
but I want to learn how to live with it.You should also add
<Directory /xyz/www>
section to apache config with something likehttp://wiki.centos.org/HowTos/SELinux
chcon -Rv --type=httpd_sys_content_t /xyz/www