skip to Main Content

I have an AWS EC2 (Ubuntu Server 18.04 LTS (HVM), SSD Volume Type) on Apache with a working WordPress site on it.

If I run sudo chown -R ubuntu:ubuntu /var/www/html, then I can edit files via SFTP and save them, but not update my plugins.

If I run sudo chown -R www-data:www-data /var/www/html, then I can update my plugins but not edit files via SFTP and save them.

How can I update my plugins and edit my files without having to run the corresponding command each time?

I have already run sudo chmod -R 755 /var/www/html.

2

Answers


  1. The permissions seems correct to me. Did you install a ftp server in the ec2 instance?
    As you don’t mention that, I guess you will have to install one than use credentials in wordpress to connect. Here’s one guide to install and configure ftp at ubuntu

    http://gabrielmagana.com/2014/11/installing-ftp-server-vsftpd-on-an-amazon-ec2-ubuntu-14-04-host/

    Login or Signup to reply.
  2. If I remember correctly, you can set the owner of the directory to www-data. Then add user Ubuntu to the www-data group.

    sudo adduser www-data ubuntu
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search