macos - 将我的“站点”文件夹与 iCloud Drive 同步?
问题描述
我担心我的本地主机文件,所以我想将它们与 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 通常以 user 身份运行_www
,并且~/Documents
通常设置其权限,以便除其所有者(即 user dafuqtor
)之外的任何人都可以访问它。
你可以通过使用 chmod 来解决这个问题,让每个人至少在你的文档文件夹(chmod o+x ~/Documents
)上执行权限,但我不特别推荐这样做;结合网络服务器,它似乎会引发错误,让您的整个文档目录向世界开放!
推荐阅读
- html - 响应式 css-grid 只有 2 个单元格
- database - 在 Crows foot ERD 中表示非此即彼的关系
- mongodb - MongoDB 查找 MainField 到 FieldA 或 FieldB
- javascript - 在javascript中更改-webkit-tekst-stroke-的颜色
- angular - 在角业力茉莉花测试中模拟服务
- c - 如何编辑 sctp.h 以添加 SO_REUSEADDR
- python - mpmath-python 中的精度上限
- python - 按类型对 python-list 中的元素进行分组
- javascript - 使用javascript在表格中添加行
- javascript - 即使 iframe 未在 Safari 上加载,iframe 也会触发加载