Currently I'm struggling with permission issues in my Drupal installation on a Drupal-VM (Vagrant + Virtual Box on Windows). I'm syncing with rsync which leads to owner and group vagrant
of synced files and folders. Because apache is running with user www-data
files cannot be written in in the public temp folder sites/default/files
, which is owned by vagrant:vagrant
. That's why I'm trying to change the group of synced files to www-data
. How do I accomplish this?
My Environment
Vagrant 1.9.1
VirtualBox 5.1.14 r112924
My OS
Microsoft Windows [Version 10.0.14393]
Summary
I've already tried the following settings in config.yml
:
vagrant_synced_folders:
- local_path: C:\#\myproject
destination: /var/www/myproject.dev
type: rsync
create: true
options_override:
group: www-data
or
vagrant_synced_folders:
- local_path: C:\#\myproject
destination: /var/www/myproject.dev
type: rsync
create: true
group: www-data
These don't take effect after vagrant reload
. When I check .vagrant/machines/mydrupalvmbox/virtualbox/syncedfolders
group
is still vagrant
. Changing the group in this temp file and doing a vagrant rsync
results the correct group for rsynced files and directories. But after vagrant reload
those temp settings are gone and group vagrant
is back again.
I've also tried to change the group via rsync_args
with no success:
vagrant_synced_folders:
- local_path: C:\#\myproject
destination: /var/www/myproject.dev
type: rsync
create: true
options_override:
rsync__args: [
"--verbose", "--archive", "--delete",
"--chmod=gu=rwX,o=rX",
"--group", # required for the following command
"--groupmap=*:www-data"
]
I get an error: Error: rsync: --groupmap=*:www-data: unknown option
.
So what's the right setting?