Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I installed Apache via yum on CentOS 6.4. I changed the DocumentRoot in /etc/httpd/conf/httpd.conf to point to /home/djc/www:

DocumentRoot "/home/djc/www"
<Directory "/home/djc/www">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

FS permissions:

djc@vm ~ $ ls -l
drwxrwxr-x.  3 djc djc   4096 Jan 14 11:17 www

No SELinux:

djc@vm ~ $ sestatus
SELinux status:                 disabled

What am I missing?

share|improve this question
    
What about ls -ld ~? –  janos Jan 14 at 10:25
1  
Doh! Thanks, that's it. If you write it as an answer, I'll accept it. –  djc Jan 14 at 10:27
    
Ok, I made it an answer ;-) –  janos Jan 14 at 10:38

1 Answer 1

up vote 3 down vote accepted

For the new docroot to be accessible by Apache, the Apache users must be able to access all directories in the path leading up to /home/djc/www. So even though /home/djc/www is accessible to everyone, /home/djc must be executable by the Apache user. so for example if you have:

$ ls -ld ~
drwx------    1 djc   djc        0 Jan 13 15:16 /home/djc

You can make it accessible like this and it should be enough:

$ chmod o+x ~
$ ls -ld ~
drwx-----x    1 djc   djc        0 Jan 13 15:16 /home/djc
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.