Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I was using this command chown root:www-data /var/www/example.com -R, but there was a message shown that directory not listed.

share|improve this question
And why did you change it to "root"? –  Rinzwind May 5 '13 at 8:55

2 Answers 2

Once you chown it to owner root and group www-data, in order to access that folder you either have to be the root user, or in the www-data group.

You can add yourself to the www-data group by doing this.

usermod -a -G www-data [your username]

Or you can use sudo to perform any tasks as root.

sudo ls -l /var/www/example.com

Or, if you of course not let root own it at all, which there shouldn't be a reason to.

chown [your username]:www-data /var/www/example.com

share|improve this answer

The right sintax:

sudo chown -R root:www-data /var/www/example.com

Parameter -R have to be first.

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.