The LAMP stack is well known because it is a web server on Linux, Apache, MySQL, and PHP. You can use the tutorial at https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html to learn more about every command and configuration concept in LAMP. Please take a moment to read it.
The following command will install the LAMP stack and create a PHP settings page, for reference:
sudo yum update -y
sudo yum install -y httpd24 php70 mysql56-server php70-mysqlnd
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 {} \;
echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.php
Now that we have configured our web server, assigned proper permissions, and created a configuration web page for PHP, let's allow...