I'm using vagrant with a synced_folder
development.vm.synced_folder "/usr/local/src/www", "/var/www", owner: "www-data", group: "www-data"
Is there a way to change the owner of a sub directory of the /var/www, say /var/www/images?
I'm using vagrant with a synced_folder
development.vm.synced_folder "/usr/local/src/www", "/var/www", owner: "www-data", group: "www-data"
Is there a way to change the owner of a sub directory of the /var/www, say /var/www/images?
Obviously a very late answer but this behavior is still true for Vagrant and some mount types. The docs states this for mount owner setting
Here: https://www.vagrantup.com/docs/synced-folders/basic_usage#owner
This means that in many cases we need to do some workaround that grants write permission but don't involve changing owner. If it's a development environment perhaps you could be a little YOLO and grant write permissions for all to the files/folders in the directory
A messy quick-fix that the ABSOLUTLY is only for development/testing
A more cleaner way would to use "find" to change directories only
Again, for development/testing only
EDIT:
Parhaps the easiest fix is to set permissions in mount options for the entire webroot.
The above code will still have user Vagrant as owner but allows all users, including www-data, to write to the entire structure. Not very safe, but working.