Allowing the guest web server to write to host

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Allowing the guest web server to write to host

Rob Wilkerson
Hey, guys --

I have a vagrant dev environment for a Wordpress site. What's missing, though, is a way for developers to upload assets using the wordpress admin. Depending on how they've configured their UMASK, the webserver doesn't often have the right permissions. Is there any way to tell Vagrant, when up'ing the VM, to make /vagrant (or any given subfolder) fully writable?

I don't see anyone else needing this in my searching so far, so am I just doing something wrong/different?

Thanks.

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Allowing the guest web server to write to host

JD Harrington
On Wed, Jan 30, 2013 at 12:02 PM, Rob Wilkerson <[hidden email]> wrote:
> I have a vagrant dev environment for a Wordpress site. What's missing,
> though, is a way for developers to upload assets using the wordpress admin.
> Depending on how they've configured their UMASK, the webserver doesn't often
> have the right permissions. Is there any way to tell Vagrant, when up'ing
> the VM, to make /vagrant (or any given subfolder) fully writable?

I think there are a couple of options hereā€¦

1) You can specify an owner/group when sharing a folder, so you could
share /vagrant as the user your httpd is running as

    config.vm.share_folder("v-root", "/vagrant", ".", :owner =>
"httpd", :group => "httpd)

2) Probably the better option - use a shell (or other) provisioner to
change permissions on the directory you need:

    config.vm.provision :shell, :inline => "chmod 777
/vagrant/path/to/upload/dir"


JD

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.