Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is what i have in my httpd.conf

<VirtualHost *:80>
        DocumentRoot /home/mcmoddr/www/
        ErrorLog /mcmoddr/logs/error.log
        CustomLog /mcmoddr/logs/accesslog combined

When visiting thwe site i get a 403 Forbidden error, The files are added with vsftpd and have the permissions drwxr-xr-x

share|improve this question

migrated from Mar 29 '12 at 15:11

This question came from our site for professional and enthusiast programmers.

You are using a stock install of CentOS, if that is correct please check that if SELinux is in Enforcing mode


if the result is "Enforcing"

temporally change it to permissive

setenforce 0

and try again, you can also guide the condition of web content to the files in your home directory.

share|improve this answer
This did the trick in my case. But if I subsequently reinforce again (with setenforce 1) the 403 error doesn't show up anymore, even though the configuration is the same as before, when it used to show up. – damix911 Nov 30 '13 at 2:23

Disable SELinux or run in ROOT

setsebool -P httpd_enable_homedirs on
chcon -R -t httpd_sys_content_t /home/
chcon -R -t httpd_sys_rw_content_t /home/
share|improve this answer

You probably have a deny all somewhere in the global config. Try adding this to the vhost stanza:

<Directory /home/mcmoddr/www>
  Order allow,deny
  Allow from all
share|improve this answer
+1, Also @Spero78 should make sure no .htaccess file is in root of your vhost with restrictive directives – user106666 Mar 28 '12 at 14:57

Freaktor's answer of 'setenforce 0' did "work" for me (thanks!)

But to keep it working and re-enable SELinux, I needed to

sudo chcon -Rv --type=httpd_t /path/to/my/files

...this gave my directory and all files and directories within it the security context of "httpd_t" which is a clunky way of saying SELinux let httpd read those files.

enabling selinux again was as simple as

setenforce 1
share|improve this answer
This is just temporary; any new files you make would have their original context and SELinux would still deny access to the new files. For a permanent solution, see this answer. – Michael Hampton Aug 10 '12 at 3:28

Your Answer


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