简体   繁体   中英

AWS Wordpress Configuration for Apache & EC2 User Access

I have for some time been manually switching my www/html directory user ownership on my EC2 Instance between apache and EC2-user for some time to allow me switch between installing and updating wordpress plugins or using Coda 2 to upload and update files via FTP.

I have finally reached a point of frustration and am wondering what is the best way to set up my ownership settings on the server to cater for both users having access without having to constantly change the settings.

Here are the commands I use to switch between users:

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

Can someone please advise the safest configurations to avoid constantly switching for the foreseeable future?

add your user to the same user group of apache.

sudo usermod -a -G apache ec2-user

then exit your account then change ownership that include ec2-user in the path

sudo chown -R ec2-user:apache /var/www

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM