Drupal EC2 AMI

WorkHabit's Drupal EC2 AMI makes it easy to put Drupal in the Cloud

We're making it easy to run Drupal on Amazon's Elastic Compute Cloud (EC2). Before now, in order to effectively run a web site on EC2, you need to pick an OS, get a web server and database server up and running, install Drupal, and connect it to persistent storage. Existing EC2 AMIs have out of date Drupal versions or don't store your data safely.

We're changing that.

We've created a pre-built AMI that makes it easy to get started with Drupal on EC2. Just start it up and you're ready to go. And it works with any version of Drupal you'd like.

What can you do with an AMI

  • QA a site. You launch a server and shut it down a few hours later when you're done.
  • Test new modules without messing with a production server.
  • Provide a platform for a development team to work on.
  • Host your production site with the peace of mind of a dedicated server with persistent storage.

What's included

The AMI includes a full LAMP stack for Drupal.

  • Fedora Core 8 Linux
  • Apache 2.2.9
  • PHP 5.2.6
  • MySQL 5.0.45
  • Drupal Installer for any version of your choice
  • PEAR
  • SSH Daemon

For performance, these Drupal tables are using InnoDB: watchdog, variable, users, node, node_access, node_comment_statistics, node_counter, node_revisions, permission, sequences, menu, history, files, comments, cache, cache_filter, cache_menu, cache_page, blocks, access, term_data, term_node, term_relation, term_synonym, and url_alias

Using the AMI

To get started, you'll need an Amazon AWS account and you'll need to subscribe to EC2 and EBS. You'll also need some tools to launch and manage AMIs. We suggest using RightScale or ElasticFox. ElasticFox is an open source Firefox extension that provides a management console for EC2. RightScale's developer edition is free and they provide some nice easy tools for managing your servers. You can also use the command line Amazon EC2 tools to manage your images.

After you get up and running with a management tool and add your EC2 credentials into it, you can grab our AMI by searching for the AMI ID: ami-7e5bbf17.

Pick a version of Drupal. That's right, we'll install whatever version you want. All you need to do is tell us what version number to use.

To start a server up, add the version of Drupal you want to use in the user data field. Various tools have different ways of doing this, but in ElasticFox, you select the image and click the green "Launch Instances" button. On the next screen, add drupal_version=5.10 to the User Data field.

Once you've made changes to User Data, feel free to make any changes to availability zones, nicknames, or other options, then click "Launch" again.

And that's it.

These instructions are also available as a screencast. Watch as we launch an AMI, step by step.

Persistent storage

When the instance starts, Drupal is on the local disk. That's not very persistent, so you'll want to connect it to an Elastic Block Storage device.

Create a volume using your Ec2 management tool. Make sure you create it in the same availability zone as your EC2 image, otherwise it can't be attached. When the volume created, use your management tool to attach the volume to your instance as /dev/sdj. Since you haven't used the volume yet, it's not formatted. You'll need to do this.

Use fdisk to create a single partition on /dev/sdj. Then format the new drive. Once you have the volume formatted, you simply run /opt/workhabit/connect-ebs.sh and we'll move your Drupal install to the persistent storage volume.

Congratulations

Your Drupal site is up and running. Your database and files are stored on Amazon's persistent storage, so you don't need to worry about losing them if you shut your instance down.

Browse to the public IP or DNS name for your instance (RightScale or your other tools will tell you what that is) and you'll be presented with an installed Drupal site.

Reconnecting storage

Once you've started the AMI and stopped it again, your data still lives on in Elastic Block Store. So when you start the AMI a second time, you'll want to get back to that data. Simply SSH into your instance and run the command /opt/workhabit/connect-ebs.sh and we'll check your AMI out and give you a list of steps to follow to connect to your data again. You'll need to know the volume ID of your EBS storage. RightScale or any other EC2 tool can provide that for you.

Updates

To update Drupal versions, just copy your new version to your EC2 server. All of your Drupal code is in EBS, so it's not clobbered when you update and stays around even when your instance doesn't.

When we release a new AMI, just shut down your existing instance and start a new one with the new AMI. Note that in order to avoid breaking changes you've made to your site, we won't update your Drupal install or database with a new AMI. Then follow the steps to reconnect your storage and you're done. Server administration headaches are gone.

Reporting Issues

Find a bug? Want a new feature? Report it on the Drupal issue queue on the project page.

WorkHabit Labs Archives