Score:0

Apache2 Permission denied - access to / denied because search permissions are missing on a component of the path

us flag

I use apache and faced with permission problem on Ubuntu 21.04

Server version: Apache/2.4.46 (Ubuntu)
Server built:   2021-06-17T17:09:41

sudo apache2ctl configtest returned Syntax OK

my logs

[Thu Jul 22 14:08:49.553904 2021] [core:error] [pid 33685] (13)Permission denied: [client 127.0.0.1:41084] AH00035: access to / denied (filesystem path '/home/ivan/hosts') because search permissions are missing on a component of the path
[Thu Jul 22 14:08:49.609382 2021] [core:error] [pid 33685] (13)Permission denied: [client 127.0.0.1:41084] AH00035: access to /favicon.ico denied (filesystem path '/home/ivan/hosts') because search permissions are missing on a component of the path, referer: http://gpon-actual.local/

my host

<VirtualHost *:80>
    ServerName gpon-actual.local
    DocumentRoot /home/ivan/hosts/gpon-actual
    DirectoryIndex index.php
    ErrorLog ${APACHE_LOG_DIR}/gpon-actual-error.log
    CustomLog ${APACHE_LOG_DIR}/gpon-actual-access.log combined
    <Directory "/home/ivan/hosts/gpon-actual">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
        Allow from All
    </Directory>
</VirtualHost>

I executed different suggestion but no of thous not helped

chmod +x hosts
chmod +rx hosts
sudo chown -R $USER:$USER hosts
sudo chmod 777 -R hosts/

In my /etc/apache2/sites-available/site.conf I added

it was before

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

and I just added after that additional:

<Directory /home/ivan/hosts/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

any idea ?

in flag
Have you given Apache access to `/home/ivan/hosts` in AppArmor?
shuba.ivan avatar
us flag
how to check it ?
in flag
If you have to ask, then AppArmor is either disabled (unlikely) or is blocking access to the `/home` directories. You can confirm its status with `aa-status`. You may need to edit the config for Apache in `/etc/apparmor.d/usr.sbin.apache2`.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.