0

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

1
  • And why did you change it to "root"?
    – Rinzwind
    May 5, 2013 at 8:55

2 Answers 2

0

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

0

The right sintax:

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

Parameter -R have to be first.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .