I’ve got WP site on a self-hosted server. Any files I create are owned by me/me and any files created by WP are owned by apache/apache. I’ve created a group, wp, that both me and apache are members of and that works ok. But how can I set this up so when either me or apache creates or edits a file or directory that it gets the wp group owner (as well as group write access)?
Thanks for the assistance.
You may as I have found need to change the group that apache runs under. In ubuntu you can do this by editing the
/etc/apache2/envvars
file.The above answer by AlxVallejo is mostly correct but this (Tom’s) is a better answer with regards to setting permissions
https://serverfault.com/questions/6895/whats-the-best-way-of-handling-permissions-for-apache2s-user-www-data-in-var
Also I found that even when you do all that, because WordPress is rather dumb on how it checks permissions adding these lines to the end of wp-config.php helps resolve plugin and auto-update hiccups:
See the link for more info.
Hope that helps.
By default, a new file will inherit the permissions of it’s parent directory.
You need to enter this on the command line:
To verify, check directory permissions
To change the actual owner, you would do
*R means it’s recursive and v means verbose and will do
ls -l
for you