Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm having some troubles with setting up my webserver (Centos 5.8). It's a brand new server and I'm trying to set a vhost to the following dir:

/home/exo/public_html

However whenever I restart httpd I get the following warning: Code:

Starting httpd: Warning: DocumentRoot [/home/exo/public_html] does not exist

Yes the directory does exist. So whenever I visit the domain exo-l.com it gives me a 403 error.

This is my config file (I put this inside my httpd.conf because the files in conf.d were not included for some reason. Or at least my newly created vhost conf file, but that has 0 priority for now)

<VirtualHost *:80>
    DocumentRoot       /home/exo/public_html
    ServerName         www.exo-l.com
    ServerAlias        exo-l.com
    <Directory /home/exo/public_html>
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost

I'm completely clueless because this should work as far as I know.

httpd is being run as apache:apache

i tried chowning the public_html directory (also recursively) to exo:apache, apache:apache, root:root with no success. chmod 777 doesn't do anything either.

a tail from the log:

[Sat Oct 13 15:10:04 2012] [error] [client 82.***.***.61] (13)Permission denied: access to / denied

[Sat Oct 13 15:10:04 2012] [error] [client 82.***.***.61] (13)Permission denied: access to / denied

I also found something about selinux and that disabling it might help, but do I really want to do that?

share|improve this question
    
type ls -ld /home/exo –  coincoin Oct 13 '12 at 13:27
    
drwx------ 3 exo exo 4096 Oct 13 05:16 /home/exo –  Ortix92 Oct 13 '12 at 13:38
1  
Why are you using CentOS 5? And why are you trying to put public web sites in user home directories? –  Michael Hampton Oct 13 '12 at 14:02
    
I see no indication that he put web site in user home directory : /home is often the only big partition if your buy preinstalled dedicated server from several isp. –  coincoin Oct 13 '12 at 14:09
    
I use centos5 because the provider messed up and i don't have time to switch to a new server. They already took a good week to deliver this piece of ****. Oh well got it fixed nevertheless Solution chcon -R -t httpd_sys_content_t /home/exo/public_html –  Ortix92 Oct 13 '12 at 14:24

1 Answer 1

up vote 0 down vote accepted

This is the answer: chcon -R -t httpd_sys_content_t /home/exo/public_html

fairly simple fix

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.