Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony2 - Deployment cache no setfacl

I'm trying to deploy my first Symfony2 app.

Blank screen when trying to access it.

Checking the log:

$ sudo tail -f /var/log/apache2/error.log

[...] Uncaught exception 'RuntimeException' with message 'Failed to write cache file [...]

Trying to put the good rights on cache & logs

$ sudo chmod +a "www-data allow delete,write,[...]" app/cache app/logs

chmod: invalid mode: `+a'

Trying with setfacl

$ sudo setfacl -R -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs

setfacl: app/cache: Operation not supported
setfacl: app/logs: Operation not supported

I imagine my partition is not mounted with acl or something similar.

Couldn't I simply chown www-data cache & logs ?

like image 723
Pierre de LESPINAY Avatar asked Jul 23 '12 10:07

Pierre de LESPINAY


2 Answers

To use setfacl, you first need to install acl utilities:

# Provided Apt can be used for package management
$ sudo apt-get install acl

Then remount the disk partition containing your symfony2 project:

# Remount the partition containing your Symfony2 application
# e.g. we could remount the root (/) partition   
$ sudo mount -o remount,acl / # 

# we could also remount the /var partition in our app lives in /var/www  
$ sudo mount -o remount,acl /var  # 

http://symfony.com/doc/2.0/book/installation.html#configuration-and-setup https://help.ubuntu.com/community/FilePermissionsACLs

like image 105
Thierry Marianne Avatar answered Nov 08 '22 08:11

Thierry Marianne


Since you're not supposed to develop on the deployment server, just give the whole app to the www-data user:

sudo chown -R www-data:www-data /path/to/the/root/of/your/app
like image 6
Elnur Abdurrakhimov Avatar answered Nov 08 '22 09:11

Elnur Abdurrakhimov