Thursday, January 17, 2013

Creating a Wordpress EBS-backed AMI


The goal is to create a customized Wordpress image that can be quickly launched for scaling purposes.
When an instance is launched with this image, all services (Apache, MySQL, etc) should start on boot and resume normal operations.

Steps for creating a Wordpress AMI:
  1. Launch a EBS-backed AMI instance (MUST be EBS-backed, not instance store-backed)
  2. When the instance is running, install required software and load applications (Apache, Wordpress).
  3. Create an image from the instance

Note that if you attach new volumes, the new AMI will contain block device mapping information for those volumes. When you launch an instance with the new AMI, the instance will launch additional volumes.

1 & 2) Launch a running Wordpress Instance

Follow Running Wordpress on Amazon EC2 to launch a running instance with all Wordpress software installed.

3) Create an image from the instance

In the AWS Management Console, click instances at the left sidebar.

Right click on the Wordpress instance created above and click on Create Image.

Fill in the image name. I like to name things in a convention that is systematic. If you are planning to write deploy scripts and do auto-scaling, it is easier to identify what an image is. I use the following convention:

{namespace}_{what_is_it}_{date}

Ex. mycompany_blog_20130118

You will want the date because you may create an image every time you deploy new codes.

Leave the other options as default, and click on Create Image.

On the left sidebar, click on AMIs under Images.

You can see the status of the AMI we just created.

You should launch an instance from this AMI and test all the data is there.

No comments:

Post a Comment