I have a vagrant instance setup e.g
~/Vagrants/devmachine
which has my webapp source code setup like
~/Vagrants/devmachine/htdocs/myapp
which is mapped to /var/www on instance/guest machine (symilink)
ls -al /var/www
lrwxrwxrwx 1 root root 25 Apr 4 10:16 /var/www -> /vagrant/htdocs/myapp/
The issue is that I am unable to change own of the /var/www files e.g
ls -al /var/www/
total 80
drwxrwxrwx 1 vagrant vagrant 782 Mar 20 06:43 .
drwxr-xr-x 1 vagrant vagrant 102 Apr 4 07:06 ..
What I am try to is change:
sudo chown www-data:www-data -R /var/www
Command is executed without error but file user/group for /var/www does not change
The reason to keep files in this way is so I can edit files easily by IDE.
Edit
I added this to Vagrantfile, but still apache2 is unable to write to files
config.vm.share_folder("v-root", "/vagrant", ".", :owner => "vagrant", :group => "www-data")