1
votes
  1. I can allow user ec2-user (Amazon AWS) write access to the public web directory (/var/www/html):

    sudo chown -R ec2-user /var/www/html 
    

    which allows me to use Filezilla.

  2. And I can allow apache write access by:

    sudo chown -R apache:apache /var/www/html
    

    which allows me to install plugins, updates, etc on Wordpress.

How can I set the permissions to be able to do both?

1

1 Answers

1
votes

Try the following:

  1. Create a group
  2. Add both users to that group
  3. Make the group own the directory
  4. Change the directory group permissions

sudo groupadd mygroup

sudo gpasswd -a apache mygroup
sudo gpasswd -a ec2-user mygroup

sudo chown -R apache:mygroup /var/www/html

sudo chmod -R g+w /var/www/html