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?

6
  • type ls -ld /home/exo Commented Oct 13, 2012 at 13:27
  • drwx------ 3 exo exo 4096 Oct 13 05:16 /home/exo Commented Oct 13, 2012 at 13:38
  • 1
    Why are you using CentOS 5? And why are you trying to put public web sites in user home directories? Commented Oct 13, 2012 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. Commented Oct 13, 2012 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 Commented Oct 13, 2012 at 14:24

1 Answer 1

0

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

fairly simple fix

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.