When accessing domain.com I'm getting this error in domain.com-error_log:

[Mon Aug 20 17:07:48 2012] [error] [client X.X.X.X] (13)Permission denied: access to / denied

I have virtual host for domain.com:

<VirtualHost *:80>
    ServerAdmin webmaster@domain.com
    DocumentRoot /home/kir/domain.com
    ServerName domain.com
    ServerAlias *.domain.com
    ErrorLog logs/domain.com-error_log
    CustomLog logs/domain.com-access_log common
    Options -Indexes +FollowSymLinks
    <Directory /home/kir/domain.com>
        RewriteEngine on
        Order allow,deny
        AllowOverride all
        Allow from all

DocumentRoot /home/kir/domain.com/ have permissions: Permissions: drwxr-xr-x (0755); User: kir/kir

After restarting httpd I have the following in error.log:

[Mon Aug 20 17:04:39 2012] [notice] caught SIGTERM, shutting down
[Mon Aug 20 17:04:40 2012] [notice] SELinux policy enabled; httpd running as context root:system_r:httpd_t
[Mon Aug 20 17:04:40 2012] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Aug 20 17:04:40 2012] [notice] Digest: generating secret for digest authentication ...
[Mon Aug 20 17:04:40 2012] [notice] Digest: done
[Mon Aug 20 17:04:40 2012] [notice] Apache/2.2.22 (Unix) DAV/2 PHP/5.3.15 configured -- resuming normal operations

As I'm using CentOs, I've tried to disabled SELinux (/etc/selinux/config.conf SELINUX=disabled ; reboot). After disabling SELinux I've tried again - the same thing, the same error (13)Permission denied...

UPD: When accessing domain.com/test.html (this file exists in DocumentRoot) the same thing (13)Permission denied.

Any ideas?

  • Do you still get the SELinux-message in your logfile after disabling SELinux? – pkhamre Aug 20 '12 at 13:31
  • @pkhamre, nope, there is no SELinux message in error.log after disabling SELinux and rebooting httpd. – Kirzilla Aug 20 '12 at 13:34
  • What are the permissions for /home/kir ? – pkhamre Aug 20 '12 at 13:35
  • @pkhamre, drwx------ (0700) – Kirzilla Aug 20 '12 at 13:37
  • 2
    Maybe this permits Apache to access directories beyond. Can you do a test by changing mode to 0755 and see if it works? – pkhamre Aug 20 '12 at 13:41

The parent directory of your DirectoryRoot must be accessible by Apache, so you must make sure that Apache got execute rights for /home/kir.

chmod 0755 /home/kir


chown kir:apache /home/kir
chmod 0750 /home/kir

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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