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.

Ok I feel like this is a very dumb question but after years of working with Ubuntu/LAMP I still don't know the answer.

Out of the box of course the Ubuntu LAMP server uses the www-data user for apache.

My question is how should I be handling ownership of these files if I am not actually using the www-data user for my own login?

If my username is aaron, then of course any files I create will be owned as aaron:aaron. What I have been doing is periodically changing ownership of all Web files to www-data:www-data. But is this the right way to do things?

I know the question seems ridiculous but I am just curious how others handle this type of thing.

Thanks!

share|improve this question

1 Answer 1

up vote 0 down vote accepted

If my username is aaron, then of course any files I create will be owned as aaron:aaron. What I have been doing is periodically changing ownership of all Web files to www-data:www-data. But is this the right way to do things?

No, don't do that, unless you need the web server to be able to modify those files. In most cases, that's unnecessary and a security downside. As long as the server can read them to serve them to the web, it doesn't matter who owns them.

share|improve this answer
    
Thanks, that makes sense. –  Aaron Lozier Mar 26 '13 at 14:15

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.