Server Fault is a question and answer site for system and network 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

I've installed CentOS 5.5 with apache, php and mysql.

Right now the /var/www/html directory is owned by the root while apache is being run by apache user from apache group.

Is that recommended? Should I chown the html directory to another user such as wwwuser:wwwgroup?

share|improve this question
Why? Are you going to have the web server write to it? – Ignacio Vazquez-Abrams Mar 31 '11 at 19:48 well...i'm confused. I guess the right way to ask this question will be: Should my website that will be in html directory be owned by root or some other user? – Stann Mar 31 '11 at 19:58
If you read up a bit on *nix permissions then you'll be in a better place to ask this question. – Ignacio Vazquez-Abrams Mar 31 '11 at 19:59
up vote 5 down vote accepted

Generally speaking, a web server's user should not have write access to anything, particularly not if it is running dynamic systems like PHP.

Apache achieves privilege separation by having the sensitive bits operate from a master process running as root, which the children can send log events to and get configuration from. The children run as unpriviliged users that should only read stuff.

share|improve this answer

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.