简体   繁体   English

将我的“Sites”文件夹与iCloud Drive同步?

[英]Sync my “Sites” folder with iCloud Drive?

I am worried about my localhost files, so I want to sync them with iCloud Drive. 我担心我的localhost文件,所以我想将它们与iCloud Drive同步。 After some attempts to do it all I get on my http://localhost is 403 Forbidden error. 经过一些尝试,我得到了我的http://localhost是403 Forbidden错误。

I've tried what I've done with my ~/Downloads folder — just replacing it with an alias to ~/Documents/Downloads , while Documents is syncing with iCloud Drive. 我已经尝试了我对~/Downloads文件夹所做的事情 - 只需用~/Documents/Downloads的别名替换它,而Documents正在与iCloud Drive同步。 But with ~/Sites folder, which is located, moreover, in the same "Home" folder ( ~/ ), it doesn't work. 但是,使用~/Sites文件夹,它位于相同的“Home”文件夹( ~/ )中,它不起作用。

DocumentRoot "/Users/dafuqtor/Sites"
<Directory "/Users/dafuqtor/Sites">

This is how my localhost directory looks in httpd.conf now. 这就是我的localhost目录现在在httpd.conf样子。 But as I said above, when I just change the DocumentRoot and Directory to "/Users/dafuqtor/Documents/Sites" , I'm getting 403 trying to access http://localhost . 但正如我上面所说,当我将DocumentRoot和目录更改为"/Users/dafuqtor/Documents/Sites" ,我正在尝试访问http://localhost

I have looked into /var/log/apache2/error_log . 我查看了/var/log/apache2/error_log For the first time, it said Cannot serve directory ... server-generated directory index forbidden by Options directive , so I added Options +Indexes to httpd.conf . 这是第一次,它说Cannot serve directory ... server-generated directory index forbidden by Options directive ,所以我在httpd.conf添加了Options +Indexes Now error_log gives me this when I'm trying to access localhost: 现在,当我尝试访问localhost时,error_log会给我这个:

access to / denied (filesystem path '/Users/dafuqtor/Documents/Sites') because search permissions are missing on a component of the path

Apache normally runs as the user _www , and ~/Documents normally has its permissions set so that nobody but its owner (ie, user dafuqtor ) can access it. Apache通常以用户_www运行,并且~/Documents通常具有其权限设置,以便除了其所有者(即用户dafuqtor )之外的任何人都可以访问它。

You could solve this by using chmod to give everyone at least execute permission on your documents folder ( chmod o+x ~/Documents ) but I don't particularly recommend this; 可以通过使用chmod来解决这个问题,让每个人至少对你的文档文件夹执行权限( chmod o+x ~/Documents ),但我不特别推荐这个; in combination with a web server it seems to invite mistakes leaving your entire documents directory open to the world! 它与Web服务器相结合似乎会引发错误,让您的整个文档目录向全世界开放!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM