Forbidden, error 403 with Apache / 2.4.6

4

I am configuring Apache / 2.4.6 on a Centos 7 server. I have created a virtual host in the following way:

<VirtualHost {IP}:80->
    ServerAdmin admin@localhost
    DocumentRoot /home/monkey/site/public
    ServerName www.monkey.net:80
    ServerAlias monkey.net
    ErrorLog /home/monkey/error.log
    CustomLog /home/monkey/requests.log combined
</VirtualHost>

Also, (according to me) I established a directive to allow apache access to this folder:

<Directory "/home/monkey/site/public">
    Allow from all
</Directory>

However, at the time of entering monkey.net I get the following error in the browser:

  

Forbidden

     

You do not have permission to access / on this server.

I proceeded to make some changes to see if it gave solution, but the error is still there:

  • Give read and write permissions to /home/monkey/site/ to /home/monkey/site/public with chmod 755 / 777 .
  • Set the directory type of site/ with the command:

    chcon -h system_u:object_r:httpd_sys_content_t /home/monkey/site/public 
    
  • Observing the logs I see that the error is detailed in the following way:

      

    [core: error] [pid 7925] (13) Permission denied: [client 186.15.110.196:56917] AH00035: access to / denied (filesystem path '/ home / monkey / site') because search permissions are missing on a component of the path

    Going around, basically what they recommend is doing what I have already done, but without positive results. I do not know if I'll be missing something. Greetings

    Edition 1/29/2016 : SELinux does not seem to be a barrier, since /var/log/audit/audit.log does not show "access denied" messages. I can buy this by doing:

    # ausearch -m AVC --start today -i
    

    Regarding the permission of the directories, I have applied 644 to all the directories up to the root:

    // 755 /home/monkey/site/public/index.php
    4 -rwxr-xr-x  index.php
    
    // 644 /home/monkey/site/public/
    0 drw-r--r-- 4  public
    
    // 644 /home/monkey/site/
    0 drw-r--r-- 4  site
    
    ...
    
        
    asked by manix 29.01.2016 в 02:46
    source

    3 answers

    1

    Complementing the issue of reputation, in general, being inside the home, it is necessary to apply execution permissions to other users of the machine. The times I have had this problem, I solve it like this:

    chmod o+x /home/monkey/site/public
    chmod o+x /home/monkey/site
    chmod o+x /home/monkey
    chmod o+x /home
    
        
    answered by 01.04.2016 / 17:40
    source
    1

    Reviewing your error: AH00035 access denied because search permissions are missing on a component of the path

      

    Typically permissions on a Unix system for resources that are not   property of the user or group specified in httpd.conf would be 644    -rw-r - r - for ordinary files and 755 drwxr-x-r x for directories or CGI scripts. It can be necessary   to check extended permissions (such as permissions for   SELinux) in operating systems that support them.

    You also need to apply the permissions with

    chmod 755
    

    you must perform for directories:

    chmod 644
    

    644 means that files have read and write permissions by the file owner and read by the users in the group owner of that file and readable by all others.

        
    answered by 29.01.2016 в 17:41
    0

    Apache 2.4 has some changes to the permissions settings of the directories, check link for more details

        
    answered by 31.05.2016 в 19:34