This repository contains a bash script to automate the process of setting up a LAMP (Linux, Apache, MySQL, PHP) stack on an AWS EC2 instance running Ubuntu 20.04 LTS.
- An AWS account with access to create and manage EC2 instances.
- An EC2 instance running Ubuntu 20.04 LTS. Make sure to configure security groups to allow inbound traffic on ports 80 (HTTP) and 22 (SSH).
-
Connect to your EC2 instance via SSH.
-
Clone this repository by running the following command: git clone https://github.com/yourusername/aws-ec2-lamp-setup.git
-
Change to the repository directory:
cd aws-ec2-lamp-setup
-
Make the
install_lamp.sh
script executable:chmod +x install_lamp.sh
-
Run the script to install the LAMP stack:
./install_lamp.sh
During the MySQL installation, you will be prompted to set a root password. Choose a strong password and keep it safe. -
Test your LAMP stack by creating a PHP info file:
echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/info.php
-
Open a web browser and navigate to
http://<your-ec2-instance-public-ip>/info.php
. You should see the PHP info page, which indicates that your LAMP stack is working correctly.
This project is licensed under the MIT License. See LICENSE for more information.