I am configuring a website for public use. The document root is currently /var/www/html and the owner/group is root/root.

So, I'm guessing that it would be best or at least better to change the owner/group of the above document root to www-data/www-data, which is the user id that handles the Apache requests. Correct?

The permissions are 755 in /var/www/html currently.

  • Good question. Not sure. The only concern I have is that user www-data is a no login user. It may be that you can set the file owner and group to this user. You can also add this user to a group that makes deploying files easier. It does not hurt to try. You can always set it back. Make sure that you restart Apache to ensure that there are no gotchas there. – closetnoc Aug 26 '15 at 2:55
  • I added a comment under the answer that Mike gave that you should read. It is an after-thought based upon reflection. – closetnoc Aug 26 '15 at 3:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.