Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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:

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?

share|improve this question
    
This didn't solve the actual problem, but executed this work around for now: stackoverflow.com/questions/7357120/… –  Josh Nankin Apr 27 '12 at 17:26

2 Answers 2

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.

share|improve this answer

A better solution is using Attribute Overriding. See Opscode Wiki http://wiki.opscode.com/display/chef/Setting+Attributes+%28Examples%29

For example in a roles defintion:

override_attributes({ "apache" => { "user" => "vagrant", "group" => "vagrant" } })

I had the same problem with Typo3 in a shared Folder, failing to create temporary files...

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.