0

I have a directory:

/home/sites/

I want apache to be able to change any files that end up in this directory. It doesn't matter what permissions or ownership individual users who log into these sites may put on their files - apache can change them.

How is this possible?

2 Answers 2

1

If you are using PHP, the best way to avoid changing ownership to apache is to use mod_fcgid with suexec. With that, each PHP files will be executes as the owner of the file. You can also use suPHP but it is less performant.

1

You can set the group of the folder sticky with following

chown -R :<apache group> /home/sites
chmod -R g+s /home/sites

That way all files saved to the directory will have group < apache group >.

1
  • This seems like an elegant and simple solution - will give it a try now. Nov 7, 2012 at 7:49

You must log in to answer this question.

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