Tuesday, April 5, 2016

linux - Wordpress shared hosting (chrooted SFTP), plugin issues



I have a server (Ubuntu 16.04) where different users can put up their own Wordpress site. Some info:




  • Apache runs as each user with mpm-itk.

  • Users are chrooted to their home dir.

  • Users can't use PHP outside their home dir.

  • Permissions is apacheuser:apacheuser recursively with 755 and 644 (also tried 777)

  • public_html lies within their home dir.




sshd-config used:



Subsystem       sftp    internal-sftp
Match Group sftpusers
ChrootDirectory /home/%u
ForceCommand internal-sftp
AllowTCPForwarding no
X11Forwarding no



The users can SFTP in, upload the WP files and be on their way.



The problem comes with updating or removing plugins (adding, activate and deactivate works fine). I get the error
Could not fully remove the plugin(s) akismet/akismet.php



Nothing in error logs.



Everywhere I search I get a few options:





  1. Install the SFTP Updater Plugin and define FS_METHOD as 'ftpsockets'. This works but I want to avoid this to keep the installation clean and the users happy. I only really admin the server, not the WP-sites themselves and forcing all users to install a plugin isn't looking good.

  2. Libssl/php-ssl. I get the loginprompt but it fails when trying.

  3. SSH keys. Think I've tried every single guide out there. The SSH session disconnects instantly. Having the same problems as this guy Wordpress SFTP auto update issues
    This would also confuse the users. It also gotta work for multiple PHP versions (FPM).

  4. define FS_METHOD as 'direct' in wp-config.php. Not working for me, same as the original error.



Anyone know what I can do to solve this?

Please let me know if there's any info you need.



Thanks!


Answer



This is solved.



Turned out it was PHPs unlink() function that was disabled with disable_functions in php.ini. Removed it from there and now everything is working.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...