I run Apache 2.2.15 on CentOS 6.4

When a web local run a function and it created files/folders owned by user "apache".

I can read these files/folders via samba but i can't write/delete them.

I've tried using chmod, but it only works for that case, when this web local run again, i can't do anything with these files.

My question is : How can i change permission for user "apache" that all users can access, write, detele.. files/folder that owned by "apache" ?

2 Answers 2


Filesystem ACLs are going to be your best solution here.

You can set a default ACL on directories, and when a file is created in that directory, it inherits the default ACL. You can then set this default ACL to allow access to the files.

For example, if you wanted to grant all users of the group mygroup read/write access to /var/www, you can do:

setfacl -R -m group:mygroup:rw /var/www
setfacl -R -d -m group:mygroup:rw /var/www

The first line sets the ACL on all the existing files. The second line sets the default for any new files.

And while I think it's a bad idea, if you really want to allow all users full access to the files:

setfacl -R -m other::rw /var/www
setfacl -R -d -m other::rw /var/www

Note that this will require your filesystem to be mounted with ACL support. If this is not currently the case, you can do so via mount -o remount,acl /var/www (or whatever the mountpoint is). Then edit your /etc/fstab and add the acl option to the appropriate line.


You can discover which group is apache user on, and add the users you want to have access to that group.

groups apacheuser


usermod -aG apachegroup useryouwant

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .