【发布时间】:2020-02-07 20:04:13
【问题描述】:
所以我使用的是 MacOS Catalina,并且我的 Apache 环境运行良好,直到我决定将我的文档根目录移动到 iCloud 驱动器以保持备份。
在我的文档根目录之前:
/users/admin/www
现在是
/users/admin/Library/Mobile Documents/com~apple~CloudDocs/www
我相应地编辑了 httpd.conf :
DocumentRoot "/users/admin/Library/Mobile Documents/com~apple~CloudDocs/www"
<Directory "/users/admin/Library/Mobile Documents/com~apple~CloudDocs/www">
Options FollowSymLinks Multiviews SymLinksIfOwnerMatch
MultiviewsMatch Any
AllowOverride All
Require all granted
</Directory>
<Directory "/users/admin/Library/Mobile Documents/com~apple~CloudDocs/www/myfolder">
Options +FollowSymLinks +Multiviews +SymLinksIfOwnerMatch
MultiviewsMatch Any
AllowOverride All
Allow from All
Require all granted
</Directory>
重新启动 Apache,重新启动机器,但现在我可以访问 127.0.0.1,除了一个特定文件夹(我们称之为 www/myfolder)。当我尝试访问 127.0.0.1/myfolder 时,出现以下错误:
Forbidden
You don't have permission to access / on this server.
检查 apache 日志文件,这是我得到的错误:
[Thu Oct 24 14:00:24.830700 2019] [access_compat:error] [pid 61703] [client 127.0.0.1:57804] AH01797: client denied by server configuration: /users/admin/Library/Mobile Documents/com~apple~CloudDocs/www/myfolder/public_html/
我在这里缺少什么?请帮忙,我需要工作:D
【问题讨论】:
-
您是否检查了 www 及其父目录的权限、所有权和组? apache 用户及其组应该可以访问所有内容
-
@niklaz 感谢您的回复,www fodler 已设置为每个人。 /users/admin/Library/Mobile Documents/com~apple~CloudDocs 也需要吗?
-
@niklaz 我刚刚添加了新信息,请帮助:D
-
您需要在父目录的所有上设置目录权限,以允许apache用户/组访问:
/users,/users/admin,/users/admin/Library,@ 987654329@和/users/admin/Library/Mobile Documents/com~apple~CloudDocs,除了www -
@Z4-tier 我需要在 httpd.conf 上添加更多内容吗?
标签: apache icloud macos-catalina icloud-drive