0

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?

Ortix92
  • 129
  • 4
  • type ls -ld /home/exo –  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. –  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
  • @Ortix92, post that as an answer and accept it. We can answer our own questions here, when we find our own solutions. – pjmorse Oct 15 '12 at 17:07

1 Answers1

0

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

fairly simple fix

Ortix92
  • 129
  • 4