0
votes

How do you set permissions for the ubuntu user and apache user on an amazon ec2 instance on the var/www folder.

What happens now is that if I own the folder by ubuntu user then the apache user is not permitted to create files and if I own using apache folder I am not able to write files using SFTP.

I want to achieve both these tasks and still have correct permissions. Thanks in advance.

1

1 Answers

0
votes

You'll want to add the ubuntu user to the same group as Apache. On Ubuntu the user and group Apache runs under is www-data. So here's the command to add the user ubuntu to the www-data group:

sudo usermod -a -G www-data ubuntu