To expand on the answer provided by @jesin , what
chown does is simply change ownership. The
chown to recursively change ownership of all files & directories in the path specified, starting from the endpoint and ending when there's nothing more to change.
Using his example,
chown -R www-data:www-data /var/www
... starting with
www, all files & directories will now be owned by the user:group
www-data. In the event you don't want
www to be owned by this user and group, you could use:
chown -R www-data:www-data /var/www/*
In most cases, I keep the first two directory locations owned by root or another non-privileged user (better option) to prevent directory traversing by other system users.
If you're hosting your content in another directory, simply swap
/var/www/ with the system path you're using. From the CLI, you can get the full path by using: