I have been trying to get to grips with Apache in CentOS 7.
I have set up two virtual hosts and created basic index.html pages as follows:
/var/www/domainA/public_html/index.html
/var/www/domainB/public_html/index.html
Both hosts have permissions as follows:
DomainA:
public_html -> jonathan:jonathan
index.html -> root:root
DomainB:
public_html -> jonathan:jonathan
index.html -> root:root
Now, what is happening is DomainA's index.html page is being served up fine, but domain B's index.html gives me a 403 Forbidden.
DomainB's error.log gives me this:
AH00132: file permissions deny server access: /var/www/DomainB/public_html/index.html
Why is this happening? It makes me very sad.
ls -ld
on allpublic_html
andindex.html
files and directories, as well as onDomainA
andDomainB
.httpd_sys_content_t
context but the non-working domain had something likeuser_root_t
context. I set this to behttpd_sys_content_t
and both domains are now working. Thanks for your help fellas.