Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
    
wait....no... 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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.