Trying to get a Symfony2 project up and running with a vagrant VM. I've seen a zillion articles on this, but getting the cache directory permissioned correctly is proving to be excruciatingly painful.
In my Vagrantfile
:
config.vm.share_folder("src", "/var/www", "../www")
My VM's fstab
file:
proc /proc proc nodev,noexec,nosuid 0 0
/dev/mapper/ubuntu--1110-root / ext4 acl,errors=remount-ro 0 1
# /boot was on /dev/sda1 during installation
UUID=4ed7eaaf-6f42-48ba-b5ed-f0c1df9add38 /boot ext2 defaults 0 2
/dev/mapper/ubuntu--1110-swap_1 none swap sw 0 0
The acl package has been installed on the VM.
When I run the following in /var/www as per the Symfony2 install directions:
sudo setfacl -R -m u:apache:rwx -m u:username:rwx app/cache app/logs
I get:
Operation not supported
I can run the command on any other directory or file on the FS (outside of the shared directory) and the command works. What gives?
To bypass all the permission problems with Symfony2 and Vagrant, the easiest solution is to change the user and group running apache to vagrant. To do so, edit the file /etc/apache2/envvars and replace lines 16 and 17 with these: export APACHE_RUN_USER=vagrant export APACHE_RUN_GROUP=vagrant Note that these instructions are for apache 2.2 on Ubuntu, refer on your apache and OS version to do so.
If you don't want to change apache user and group, you could also mount a ramdisk and put your symfony project on it. Then vagrant can modify the permissions on this disk. See this link for instructions on how to mount a ramdisk.
A better solution is using Attribute Overriding. See Opscode Wiki.
For example in a roles defintion:
I had the same problem with Typo3 in a shared Folder, failing to create temporary files.