1

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.)
  • I am interested in this as well because what I do on my vps is actually this. 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. – NextGenThemes Apr 13 '17 at 9:38
  • I think this is not nginx specific and applies to other web-servers as well. – NextGenThemes Apr 13 '17 at 9:40
  • There may be a way with sticky permissions or something. – NextGenThemes Apr 13 '17 at 9:43
1

Shouldn't u add rachel to the www-data group?

sudo usermod -aG www-data rachel

More details https://stackoverflow.com/a/19620585/1173445

  • thanks for the hint. Unfortunately it didn't work :( I have updated my question above with what I tried – Andrew Newby Apr 13 '17 at 9:27
0

Try to run these commands:

sudo chown www-data:www-data /home/rachel/web/site.co.uk/public_shtml -R

sudo chmod g+w /home/rachel/web/site.co.uk/public_shtml -R
  • Thanks. While that works, the problem is that then stops the FTP user from being able to view/edit the files :( – Andrew Newby Apr 13 '17 at 13:23
  • Then put it back "sudo chown rachel:rachel /home/rachel/web/site.co.uk/public_shtml -R" and run only the second line: "sudo chmod g+w /home/rachel/web/site.co.uk/public_shtml -R" – ciaika Apr 13 '17 at 13:27
  • that takes me back to the same problem :) I'm just having a read of this, to see if I can understand how it works - digitalocean.com/community/tutorials/… – Andrew Newby Apr 13 '17 at 13:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.