0

I have apache2 server, of course apache2 is running on www-data account.

All my WordPress files is own by root:webmaster, and have the g+w permission.

Three of the accounts in webmaster group are www-data, sftp_www, and root itself.

The permission thing seems to be really, really good. Here are the copied text from the terminal, the same one with the screenshot above.

root@srakrn:/var/www/html/blog/wp-content# ls -l
total 20
-rw-rw-r-- 1 root     webmaster   28 Jan  8  2012 index.php
drwxrwsr-x 4 root     webmaster 4096 Jun  5 06:38 plugins
drwxrwsr-x 5 root     webmaster 4096 May  6 18:33 themes
drwxrwsr-x 2 root     webmaster 4096 Jun  5 06:38 upgrade
drwxrwsr-x 3 www-data webmaster 4096 Jun  5 08:55 uploads
root@srakrn:/var/www/html/blog/wp-content# groups www-data
www-data : www-data webmaster

This is what WordPress has asked: the FTP password. Usually WordPress won't ask for FTP password if the directory is writable by WordPress.

So, even the plugin folder is writable by the account www-data, why can't it install plugin files?

srakrn
  • 143
  • 1
  • 1
  • 5

1 Answers1

0

Try changing the owner of the plugins directory to www-data temporarily. The permission check is done by parsing the directory listing. Changing the group to www-data may work.

BillThor
  • 27,737
  • 3
  • 37
  • 69
  • Yes, that worked, but I think this isn't what I should have to do. Normally, when uploading files to /var/www with sftp_www, the server should be able to write files. `chown`ing shouldn't be needed if things are configured correctly. – srakrn Jun 06 '16 at 06:03
  • @user3903685 Unless you want your site to be powened you want to severely limit the locations that can be written by your web server. Normally, this would be limited to an uploads directory which does not allow execution by the web server. Allowing you to update WordPress directly from wordpress without using ftp or sftp weakens security. However, it does make updating a development site NOT accessible from the internet simpler. – BillThor Jun 06 '16 at 23:10