Yii Apps on Amazon EC2

I am looking for experiences/advice on deploying YII apps to the Amazon EC2 cloud. -

Has anybody build a customized AMI (Apache, MySQL, MemCache, PHP with all necessary extension etc.) ?

Which AMI is a good base to start with?

I have asked this question as well. Haven’t gotten any responses either :(

I’ve played around a little with ec2 and achieved a workable setup, but i wouldn’t be able to replicate all the steps i took, and certainly wouldn’t be able to automate it (which is the whole point of using ec2).

Hope somebody out there can give us some insight.

The choice of AMI is very largely a matter of preference and scale. Use whichever distro you feel most comfortable with (I’m presuming you’re deploying on linux!)and how big does it need to be. Done right, the size becomes irrelevant, because it will be so easy to move to a larger server when you need to.

I’ve used the Amazon Linux AMI for most of the things I’ve created on there lately (which is a Redhat based distro) though for my current project (actually a site about building scaleable cloud sites that avoid lockin) I’ve been playing with Ubuntu (again on a drive to avoid lockin as much as possible)

My philosophy for building sites on AWS is to script everything. Which can be quite a daunting concept when you’re sitting looking at a live site and wondering how the hell you got there.

However it isn’t as complex as it first sounds, the first step is seperating the data from the configuration.

If a system that I have built needs rebuilding, relaunching etc, the process goes something like… (it is specifically designed to be able to run on a blank server, to aid migration to other vendors)

  • a small script connects to S3 and downloads the build script.

  • build script updates server

  • installs software (yum install apache php… )

  • creates and attaches additional volumes

  • downloads latest backup

  • copies application data.

  • copies config files into place.

  • starts services.

Remember that all of your configuration is sitting in files. Copy the files back into place and you’re away.