I successfully installed everything on my ubuntu linode (nginx, php-fpm etc) for my wordpress website.
I created additional user "someuser", disabled root login, and password authentication. By following themesforge tutorial - I did chown of my site folder, and owner of site files is www-data.
That's ok, wp works, I can install plugins, update plugins, but I can't do anything with my FTP, cause my user "someuser" is not owner of the files. I get that.
If I chown site files, and file owner is my "someuser" instead of www-data, I can edit files via FTP, but wp updates, plugin installations are not working.
How can I solve this? I want to be able to use FTP and WP to be able to install plugins from backend?
USER / GROUP
someuser / www-data ~~ for the site's main directory (/var/www/someuser)
someuser / www-data ~~ for the site's content directory (/var/www/someuser/mysite.com)
someuser / someuser ~~ for all the files in the site we want available for SFTP.
For files we don't want to be available to SFTP we change the user to another user.
2. chown -R someuser:someuser /home/someuser
3. chmod -R 755 /home/someuser/*
Then, go into the WordPress directory and chmod -R 775 any plugins folders or anything you need writable specifically.
You should also go add someuser in as a worker in nginx.conf (then restart):
The configuration you have with someuser:www-data should work, so that leads me to think it's just a chmod permissions issue. I just find it easier to maintain when all of the files in a /home/user folder are owned by user.
Hope this assists.
Then, when you want a directory, or file, to be writable by www-data, you simply make it group-writable. This you can do via SSH or FTP as user 'someuser'. An ordinary user can modify directory/file permissions but cannot change ownership.