I'm trying to figure out how to let Wordpress update on my server, without needing FTP credentials. In /etc/php/7.0/fpm/pool.d/www.conf
I have:
listen.owner = www-data
listen.group = www-data
The problem I think is the way VestaCP is setup with the files:
root@com:/home/rachel/web/site.co.uk/public_shtml# ls -lh
total 243M
drwxrwxr-x 11 rachel rachel 4.0K Feb 3 2016 admin
drwxrwxr-x 2 rachel rachel 4.0K Apr 12 09:14 cgi-bin
drwxrwxr-x 3 rachel rachel 4.0K Jan 28 2016 dir
-rw-rw-r-- 1 rachel rachel 418 Sep 25 2013 index.php
-rw-r--r-- 1 rachel rachel 2.1K Apr 6 09:15 optimize.cgi
drwxr-x--x 2 rachel rachel 4.0K Apr 12 09:12 public_shtml
the "owner" of them is actually the user's account username. I'm sure this must be possible (otherwise every file has to be owned by www-data, which causes all kinds of other issues)
Am I just being stupid?
UPDATE:
As suggested, I've tried:
sudo usermod -aG www-data rachel
Unfortunately I still get the error:
PASS: Your WordPress install can communicate with WordPress.org securely.
PASS: No version control systems were detected.
FAIL: Your installation of WordPress prompts for FTP credentials to perform updates. (Your site is performing updates over FTP due to file ownership. Talk to your hosting company.)
sudo sudo usermod -a -G www-data myusername sudo chown -R www-data:www-data /srv sudo find /srv -type f -exec chmod 664 {} \; sudo find /srv -type d -exec chmod 775 {} \; sudo find /srv -name "wp-config*.php" -exec chmod 440 {} \;
I never figured out a way to write files with to for example upload a plugin over sftp with a user but then let wordpress update it. I always run my script with the recommended permissions after and make everything owned to www-data otherwise I not got it to work.