Create a Custom AMI in AWS


Launch a Configuration Instance

Launch an instance from a Base AWS Linux AMI:

  • Login to the Management Console
  • Launch EC2 instance using AWS Linux AMI:
    • t2.micro
    • Public IP
    • Create a Security Group with SSH an HTTP access
    • Download a Key Pair

Install Apache and PHP

SSH to the instance and execute the following commands to install Apache and PHP:

  • sudo yum update -y
  • sudo yum install -y httpd24 php70
  • sudo service httpd start
  • sudo chkconfig httpd on

Create a PHP page with the following commands:

  • sudo usermod -a -G apache ec2-user
  • sudo chown -R ec2-user:apache /var/www
  • echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.php

Create a Custom AMI

In the EC2 Management Console, create an image from the config instance:

  • Select the instance in the console
  • Under the Actions menu, choose Create Image:
    • Name the Image

      Create-a-Custom-AMI-in-AWS-

      how-to-Create-a-Custom-AMI-in-AWS-

      Custom-AMI-is-available

 

  • Launch an instance from the new Image

    Custom-AMI-Available-under-instance

Want to pass AWS Certified Solutions Architect – Associate Level?  Check out https://linuxacademy.com training

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s