Apache目录访问权限

Apache 设置虚拟目录

<VirtualHost *:80>  
    ...
    Alias /doc "/home/node/public-api/current/doc"
    <Directory "/home/node/public-api/current/doc">
            Options Indexes FollowSymLinks
            AllowOverride None
            Order allow,deny
            Allow from all
            Require all granted 
    </Directory>
    ...
</VirtualHost>  

访问 http://127.0.0.1/doc/ , 返回没有权限访问的错误

Forbidden

You don't have permission to access /doc/ on this server.  
Apache/2.4.10 (Debian) Server at 127.0.0.1 Port 80  

解决方法

逐级查看 /home/node/public-api/current/doc 目录权限, 发现 /home/node 目录没有可执行权限

$ ls -ld /home/node
drwx------ 18 node node 4.0K Sep  6 14:55 /home/node  
$ chmod +x /home/node 
$ ls -ld /home/node
drwx--x--x 18 node node 4.0K Sep  6 14:55 /home/node  

参考: Permissions issue: how can Apache access files in my Home directory?