WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im not sure if this question is about server, git or wordpress. i have wordpress set up on ubuntu VPS in /home/user its working now when all chown and group is "user".

however, when i git pull (as user root) it set the files owner and group to root. then they dont work.

so either wordpress should be able to run with files who have root ownership, or somehow the wordpress directory should automatically chown when i pull, possible?

share|improve this question

WordPress and Apache
WordPress needs to be able to use Apache. By default Apache runs on Ubunutu as user www-data. And ... www-data is also a member of the group www-data

So when you try to do a Git Pull then every file will have the wrong permissions as it's expecting the owner to be able to run things on Apache.

If you do a CHOWN to make everything under your '/wordpress' directory to be owned by www-data everything should be fixed ... run this command:

sudo chown -R www-data:www-data /wordpress

You'll need to run this command as sudo. And you may need to check your permissions on folders under wp-content

share|improve this answer
right. BUt the problem is anything i run as root again takes the owner and group of root. so if i git pull as root, then the file i pull in becomes root. on ServerFault i asked this and someone said i just need to run as user and sudo. seems so. – petergus Aug 12 '12 at 21:20
Then set your user to the primarty group www-data then it will be ok. That will mean the user and apache and therefore Wordpress will work – Damien Aug 12 '12 at 21:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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