To give apache access to my public_html directory, I'd change ownership for the directory and all of its contents:
chown -R brad:www-data public_html
I may also need to allow apache to write to a certain directory:
chmod g+w public_html/somedir
Now, if I modify any files in public_html, I don't want to have to change the group permissions (that is, apache's permissions), so lets make the group ownership sticky:
chmod g+s public_html
Now, any new files that I add beneath the public_html directory will be part of the www-data group.
comments powered by Disqus