How can I share the app (wp-content) directory between different sites?

I cam coming from VVV and there I use my fstab (ubuntu) to bind the wp-content dir to multiple sites. What is new to me is this way Trellis handles the folders. Why is is using this binding thing or this local network thing and not guest folders?

/home/user23/wp-content /home/user/webdev/websites/site1.com/web/app     none bind 0 20
/home/user23/wp-content /home/user/webdev/websites/site2.com/web/app     none bind 0 20
/home/user23/wp-content /home/user/webdev/websites/site3.com/web/app     none bind 0 20

This is not working. The sites can not read the directory even the files are there. Should I enable symlinks for the nginx inside the VM. Does my main app directory then needs to be inside the trellis setup (in a bedrock/site location) or can it be outsite?

Trellis is using Vagrant’s synced_folderwith NFS sharing. But we also use bindfs to solve some permission issues.

You can read more on that link, but it roughly does this automatically:

  • mount your share over NFS into a temporary location in the guest
  • re-mount the share to the actual destination with vagrant-bindfs, setting the correct permissions

Thanks can you be a little more specific how I do this?

So I need to do this all on the guest? I have actually never used NFS, I just looked at my hosts config file and saw vagrant set some things in there. So I need to edit the NFS config file while logged in to the trellis box over ssh? Mount it anywhere? And then setup findfs? I saw some lines about bindfs in the vagrantfile of Trellis but I do not know what permission, where and how I should set this up to share a folder between WP installs.

Honestly I have no idea how to do what you want. I’ve never needed to do anything like that.

I was just trying to provide a little more info on our setup. So unless someone else knows more about this, you’ll be a pioneer on this one :slight_smile: