You are not logged in.

#1 2012-01-21 11:58:41

archer42
Member
Registered: 2011-06-10
Posts: 92

Advanced permissions

Hi,

the cache in Symfony2 requires a dir which is usable for the webserver and me.

They recommand three techniques to do this:

1. Using ACL on a system that supports chmod +a

rm -rf app/cache/*
rm -rf app/logs/*

sudo chmod +a "www-data allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs

2. Using Acl on a system that does not support chmod +a

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

3. Without using ACL

umask(0002); // This will let the permissions be 0775

// or

umask(0000); // This will let the permissions be 0777

The 3. isn't the best solution and 1. and 2. don't work under archlinux.
Is there a possibility to add these permissions with chattr?

Last edited by archer42 (2012-01-21 11:59:29)

Offline

#2 2012-01-21 15:24:04

archer42
Member
Registered: 2011-06-10
Posts: 92

Re: Advanced permissions

I know looked a little threw wiki:

sudo setfacl -R -m u:http:rwx -m u:<user>:rwx app/cache app/logs
setfacl: app/cache: Die Operation wird nicht unterstützt
setfacl: app/logs: Die Operation wird nicht unterstützt
setfacl: app/logs/.gitkeep: Die Operation wird nicht unterstützt

Do I have to add acl as option for my home dir?

Offline

#3 2012-01-21 16:39:53

Blµb
Member
Registered: 2008-02-10
Posts: 224

Re: Advanced permissions

Not all filesystems support this option. ext3 for exampl doesn't, while ext4 on the other hand does.
What filesystem are you working on?


You know you're paranoid when you start thinking random letters while typing a password.
A good post about vim
Python has no multithreading.

Offline

#4 2012-01-22 06:43:01

archer42
Member
Registered: 2011-06-10
Posts: 92

Re: Advanced permissions

I have my /home mounted over NFS. The Server uses ZFS.

Could it be that I have to switch to NFSv4 to use ACL?

Offline

Board footer

Powered by FluxBB