I'm lost with this, hopefully I can find some help here:I have Ubuntu 12.04 LTS webserver.For example I have user myuser. There is a public directory which is my web root. I chowned it and all files in it as www-data:www-data. This enabled me proper work of PHP which can create/write files as PHP and web server run under www-data./home/myuser/public/My problem is that when I transfer files with rsync through ssh my permissions, user and group for the files are changed. This mean after every transfer I have to do my chown again.rsync -azv . -e ssh myuser@server.com/public/I'm not sure if chown-ing the files is the right way, but I followed this tutorial at DigitalOcean: https://www.digitalocean.com/community/articles/how-to-install-wordpress-with-nginx-on-ubuntu-12-04 and they do the following:sudo chown www-data:www-data * -R sudo usermod -a -G www-data usernameAs well as in other tutorials.I need some way when I will be not need to chown/chmod or whatever my files after each transfer (same as it works on shared hostings)Any ideas how to achieve that?
How to properly setup web server directory permissions
ubuntu;permissions;rsync;webserver;nginx