AWS Classroom Series – 09/Oct/2021

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
    • Preview
  • Activity 2: Ensure your Ec2 instance has tags
    • Lets create the following tags
      • Name: webserver
      • env: Dev
      • project: lthrms Preview Preview Preview
  • 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> and http://<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 Preview
    • Now lets open http (tcp => port 80) Preview Preview Preview
  • 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

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Social Network Widget by Acurax Small Business Website Designers

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube