我正在尝试使用vagrant设置synced文件夹,设置在linux机器上运行完美但Mac OSX(10.10),它没有加载具有预期用户/组权限的文件夹:
config.vm.synced_folder "./hp", "/var/www/hp",
:rsync => true,
:user => 'www-data',
:group => 'www-data',
:rsync__chown => true,
:rsync__verbose => true,
:rsync_exclude => [".git/"]
所以权限看起来像
vagrant@vagrant-ubuntu-trusty-64:~$ ls -al /var/www
total 16
drwxr-xr-x 5 www-data www-data 4096 May 27 13:35 .
drwxr-xr-x 14 root root 4096 May 10 05:39 ..
drwxr-xr-x 1 vagrant www-data 952 May 27 16:56 hp
drwxr-xr-x 2 root root 4096 May 10 12:54 html
答案 0 :(得分:0)
应为owner
而不是user
,因此www-data
将拥有hp共享文件夹
config.vm.synced_folder "./hp", "/var/www/hp",
:rsync => true,
:owner => 'www-data',
:group => 'www-data',
:rsync__chown => true,
:rsync__verbose => true,
:rsync_exclude => [".git/"]