【发布时间】:2019-05-09 09:21:06
【问题描述】:
我担心我的 localhost 文件,所以我想将它们与 iCloud Drive 同步。经过一些尝试后,我发现我的 http://localhost 是 403 Forbidden 错误。
我已经尝试了我对 ~/Downloads 文件夹所做的操作 — 只是将其替换为 ~/Documents/Downloads 的别名,而 Documents 正在与 iCloud Drive 同步。但是对于位于同一“主”文件夹 (~/) 中的 ~/Sites 文件夹,它不起作用。
DocumentRoot "/Users/dafuqtor/Sites"
<Directory "/Users/dafuqtor/Sites">
这就是我的 localhost 目录现在在 httpd.conf 中的样子。但正如我上面所说,当我将 DocumentRoot 和 Directory 更改为 "/Users/dafuqtor/Documents/Sites" 时,我会收到 403 尝试访问 http://localhost。
我已经调查了/var/log/apache2/error_log。第一次说Cannot serve directory ... server-generated directory index forbidden by Options directive,所以我把Options +Indexes加到httpd.conf。
现在,当我尝试访问 localhost 时,error_log 给了我这个:
access to / denied (filesystem path '/Users/dafuqtor/Documents/Sites') because search permissions are missing on a component of the path
【问题讨论】:
-
Apache 通常在 /var/log/apache2/error_log 中记录错误。从那里开始。
-
@TurePålsson 现在 error_log 给了我这个——
access to / denied (filesystem path '/Users/dafuqtor/Documents/Sites') because search permissions are missing on a component of the path。