Skip to content

Instantly share code, notes, and snippets.

@zh-wang
zh-wang / ec2_www.sh
Created September 22, 2022 02:03 — forked from lostandfound/ec2_www.sh
EC2のAmazon Linux で ec2-user を apache グループに追加し、/var/www ディレクトリに apache グループの所有権を与え、グループに書き込み権限を割り当てる
#!/bin/sh
# EC2のAmazon Linux で ec2-user を apache グループに追加し、
# /var/www ディレクトリに apache グループの所有権を与え、グループに書き込み権限を割り当てます。
# source http://docs.aws.amazon.com/ja_jp/AWSEC2/latest/UserGuide/install-LAMP.html
ls -l /var/www
# ユーザー(この場合は ec2-user)を apache グループに追加します。
sudo usermod -a -G apache ec2-user