我正在尝试设置一种情况,可以通过 FTP 传输到我的 Linux CentOS 7 服务器并从我的 Windows 7 系统更新网站文件。此时,我可以使用 vsftp (/home/robert) FTP 到我的用户文件夹,并且 Apache 似乎适用于默认网站 (/var/www/html)。我为端口 8080 创建了一个虚拟主机,如果我将其指向 /var/www/8080/public_html,它工作正常,但一旦我将其指向 /home/robert/public_html,它就会返回 403 Forbidden。您没有权限访问此服务器上的 /。\napache 错误日志显示
\n\n[Wed Mar 18 16:12:27.546621 2015] [core:error]\n[pid 21204] (13)Permission denied: [client 192.168.1.66:57090]\nAH00035: access to / denied (filesystem path '/home/robert')\nbecause search permissions are missing on a component of the path\nRun Code Online (Sandbox Code Playgroud)\n\napache conf 文件 (/etc/httpd/conf/httpd.conf) 有此虚拟主机条目
\n\nListen 80\nListen 8080\n\n# Virtual Hosts\n<VirtualHost *:8080>\n ServerName 192.168.1.10:8080\n# DocumentRoot /var/www/8080/public_html\n DocumentRoot /home/robert/public_html\n</VirtualHost>\nRun Code Online (Sandbox Code Playgroud)\n\n/home/robert/public_html/index.html 的权限如下
\n\ndrwxr-xr-x. 7 root …Run Code Online (Sandbox Code Playgroud)