Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

closed as off topic by Stephen Harris, anu, Brady Jul 2 '12 at 11:56

Questions on WordPress Development Stack Exchange are expected to relate to WordPress within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers

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 http://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:

/* Force direct file updating
 - http://www.charleshooper.net/blog/wordpress-auto-upgrade-and-dumb-permissions/
*/
define('FS_METHOD', 'direct');

See the link for more info.

Hope that helps.

share|improve this answer
add comment

By default, a new file will inherit the permissions of it's parent directory.

You need to enter this on the command line:

chmod -R apache_group=664 directory_name

To verify, check directory permissions

ls -l

To change the actual owner, you would do

chgrp -Rv apache_group wp_content

*R means it's recursive and v means verbose and will do ls -l for you

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.