https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-lamp-amazon-linux-2.html
Add your user (in this case,
ec2-user) to theapachegroup.[ec2-user ~]$sudo usermod -a -G apacheec2-userLog out and then log back in again to pick up the new group, and then verify your membership.
Log out (use the exit command or close the terminal window):
[ec2-user ~]$exitTo verify your membership in the
apachegroup, reconnect to your instance, and then run the following command:[ec2-user ~]$groupsec2-user adm wheel apache systemd-journal
Change the group ownership of
/var/wwwand its contents to theapachegroup.[ec2-user ~]$sudo chown -R ec2-user:apache /var/wwwTo add group write permissions and to set the group ID on future subdirectories, change the directory permissions of
/var/wwwand its subdirectories.[ec2-user ~]$sudo chmod 2775 /var/www && find /var/www -type d -exec sudo chmod 2775 {} \;To add group write permissions, recursively change the file permissions of
/var/wwwand its subdirectories:[ec2-user ~]$find /var/www -type f -exec sudo chmod 0664 {} \;
Now, ec2-user (and any future members of the apache group) can add, delete, and edit files in the Apache document root, enabling you to add content, such as a static website or a PHP application.
Không có nhận xét nào:
Đăng nhận xét