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.

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
    </Directory>
</VirtualHost>

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?

share|improve this question
    
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
show 3 more comments

1 Answer

up vote 3 down vote accepted

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

or

chown kir:apache /home/kir
chmod 0750 /home/kir
share|improve this answer
add comment

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.