xforty / vagrant-drupal

Template repo for a new drupal project built on top of a vagrant vm.
Other
46 stars 11 forks source link

Web server can't write to files when using nfs shared folders #30

Open dkingofpa opened 12 years ago

dkingofpa commented 12 years ago

When using nfs shared folders, we can't change the owner or group of the files directory and the default permissions do not allow world-writable. Two options I can think of off the top of my head:

  1. Set permissions to 777 (yuck)
  2. Set web server to run as the folder owner of the nfs shared folders. On Ubuntu, it's dialup.

More thought is required.

wizonesolutions commented 11 years ago

I think that when using NFS with Vagrant, everything is already writable by everyone (even though it doesn't look that way). I've never had permissions problems with it, at least, and it has totally saved me in comparison to vboxsf and Drupal.

dkingofpa commented 11 years ago

@wizonesolutions What platform are you running? I believe NFS works fine when linux is the host. The issue I see is on a Mac. Something to do with no_root_squash. https://github.com/mitchellh/vagrant/issues/844

wizonesolutions commented 11 years ago

Host is Mac OS X 10.7.5. Maybe I haven't run across the specific case here though? I do have my files directory shared from the host over NFS. On Dec 31, 2012 4:37 PM, "David King" notifications@github.com wrote:

@wizonesolutions https://github.com/wizonesolutions What platform are you running? I believe NFS works fine when linux is the host. The issue I see is on a Mac. Something to do with no_root_squash. mitchellh/vagrant#844 https://github.com/mitchellh/vagrant/issues/844

— Reply to this email directly or view it on GitHubhttps://github.com/xforty/vagrant-drupal/issues/30#issuecomment-11779023.

datr commented 11 years ago

I ran into this issue recently I was able to get around it by adding the web server user to the vagrant group is the guest os.

8bitjoey commented 7 years ago

When added www-data to vagrant group the guest OS stopped loading with "Warning: Authentication failure. Retrying...". Removed www-data from vagrant group and everything works again.

Just tried adding mount_options: ["uid=33", "gid=33"] option to synced_folder config and that did the trick (uid and gid are specified for www-data user and group).