Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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'm a noob here. I would like to know whether I will have any issues if I change ownership of /var/www to www-data, and what is the significance of www-data?

share|improve this question
up vote 1 down vote accepted

/var/www traditionally holds the necessary files to serve a website using a HTTP server such as Apache. Apache is executed by the user www-data, so interactive elements of the website (e.g., PHP scripts) have write access to pretty much everything owned by www-data.

Owning /var/www by www-data is undesirable by the principle of least privilege. There's usually no need for a PHP script able to modify itself or other parts of the website.

If, for some reason, www-data needs to be able to modify or create some files, you can grant write permissions to those specific files (for modification) or write and execution permissions to a folder (for file creation) by owning them.

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.