Activities on AWS EC2
- Activity 1: Create an AWS EC2 instance with ubuntu os
- Steps:
- Instance type: t2.micro
- Region: mumbai
- Availability Zone: ap-south-1a

- Steps:
- Activity 2: Ensure your Ec2 instance has tags
- Lets create the following tags
- Name: webserver
- env: Dev
- project: lthrms

- Lets create the following tags
- Activity 3: Lets try to install apache and php in the linux instance
- Try to execute the following commands in the ec2 instance
sudo apt update sudo apt install apache2 -y sudo apt install php libapache2-mod-php php-mysql -y # Create a file in /var/www/html/info.php "<?php phpinfo(); ?>" echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/info.php sudo service apache2 restart- Now navigate to the
http://<publicip>andhttp://<publicip>/info.php - If you are unable to access the application, your security group might be blocking the 80 port as in this case where only 22 port is open

- Now lets open http (tcp => port 80)

- Activity 4:
- Make a note of public ip address and private ip address
- Stop the ec2 instance & wait for the instance to be stopped
- Start the ec2 instance again after the status turned to stopped (wait for 5-10 seconds)
- Now make a note of public ip and private ip
- Share your observations: Private ip address remained the same, where as public ip was changed.
- In some cases we would want a static public ip address, then we need to create Elastic IP Address
