AMI Linux2‎ > ‎

apache/httpd

## install software
sudo yum update -y
sudo amazon-linux-extras install -y lamp-mariadb10.2-php7.2 php7.2 -y
sudo yum install  httpd  -y

## service
sudo systemctl enable httpd
sudo systemctl start httpd

## document root settings
sudo usermod -a -G apache ec2-user

sudo chown -R ec2-user:apache /var/www
sudo chmod 2775 /var/www && find /var/www -type d -exec sudo chmod 2775 {} \;
find /var/www -type f -exec sudo chmod 0664 {} \;


Extra
## Configure public_html
enable mod usedir
mkdir public_html
chmod 711 ~
chmod 755 ~/public_html




Comments