Drupal in the Cloud, Part 2C: Give your AWS Instance a Public IP

Share this

This part is fairly simple. If you are using AWS, your server does not get a public IP by default. This means that from the internet, your server is only accessible by that public DNS name when it is first launched.

However, it's fairly straightforward to give it a public IP using Amazon's Elastic IP service.

  • From the EC2 Navigation, select Elastic IP on the left-hand side


Drupal in the Cloud, Part 2B - Connecting to your AWS Instance

Share this

If you're using Linux or a Mac, this will be super easy. If you've got Windows it will be slightly harder. But only slightly.

Connecting to your Instance with Linux or a Mac

  • From the EC2 Console, locate your instance.
  • Select your instance and scroll down on the info page until you get to the Public DNS. Save this for later.
  • Open a terminal session and go to the folder that you saved the Key Pair in. Using the Public DNS address and your Key Pair name, type the following to connect to your AWS Instance:

    ssh -v -v -i *****.pem ubuntu@ec2-XX-XX-XX-XX.us-west-1.compute.amazonaws.com

Connecting to your AWS Instance with Windows

  • From the EC2 Console, locate your instance.
  • Select your instance and scroll down on the info page until you get to the Public DNS. Save this for later.
  • Download PuTTY from here. You will need both PuTTY and PuTTYGen, but if you do the full Windows installer you'll get them both.


Drupal in the Cloud, Part 2A - Amazon's Web Services

Share this

In Drupal in the Cloud: Part 1 I went over some basic background for why I wanted to use the cloud. If you are planning on using Amazon's Web Services, or AWS, start here.

AWS is a tricky beast. Nothing is truly external, at least not without some authorization keys. I'm not going to go over signup completely, but be warned- it involves a phone call, a credit card, and your first born son. Ok, maybe not the last one, but it sure feels like it.

Once you are signed up, you'll see a bunch of services they offer. The one that we are looking for is EC2, which stands for Elastic Computing Cloud. This is essentially their "cloud server", which they refer to as an Instance.

  • From the EC2 Console Dashboard, click on the Launch Instance button.
  • There are three options to choose from, select the Classic Wizard and continue
  • Depending on your budget and needs you can select a different instance type, but for me the 613MiB RAM Micro instance will be just fine. If you have a Zone preference you can select that as well, but the Micro instances are limited to only a few zones.
  • Select the most recent Ubuntu LTS release, which is 12.04 at the time of this writing.


Drupal in the Cloud, Part 1 - Reasons and Background

Share this
We all have different needs and reasons for Drupal, but at the same time we all want the best performance for our money. That's why I started out on shared hosting, and odds are why you did too. It's hard to pass up $6/month with a free domain name! But all that glitters is not gold, and you may have found yourself stuck with only 32MB of memory and trying to do image processing, or no support for HTML5 video or FFMPEG for conversions. Fear not! Where you used to only have two real options, shared hosting and VPS (Virtual Private Server), you now have The Cloud! Ok, The Cloud isn't some magical entity that makes your experience any easier. Quite the opposite, in fact. It'll make you appreciate your install and resources that much more. The Cloud is simply a virtual server out in a data center that you have access and control over. How it gets used, and what kind of resources it has are up to your discretion. Rackspace offers more traditionally recognized server setups, with memory/disk sizes at 256MB/10GB, 512MB/20GB, 1GB/40GB, and way up. Amazon Web Services offers a little more untraditional sizes with more emphasis put on the processor and memory size than disk space. After all, they want you to use S3 for storing your files! Ok, on to the meat of the topic: installing. Here's a list of software I'm using in order to put Drupal in the cloud:
  • Ubuntu - The OS that the web server runs on
  • VirtualMin - The software that manages Apache, MySQL, and PHP
  • Apache - The web server that Drupal will use
  • MySQL - The database that Drupal will use
  • PHP - The server-side code that Drupal runs on
  • Fail2Ban - Temporarily bans IP addresses after a set number of failed login attempts
Now that we have a basic overlay we can continue to the other parts:


Drupal Multi-Site with the Domain Access module

Share this
I'll get to doing a guide or video soon, but here are some notes of what I did:
  • In Virtualmin, create a virtual server for domain1.com
  • Do a basic Drupal install (domain1.com)
  • Install the Domain Access module on domain1.com
  • Back in Virtualmin, create domain2.com as a sub-domain of domain1.com
  • Within the Webmin part of Virtualmin, edit the Apache server directives for domain2.com
  • You should see something like this in the site list:
    • Server Name: domain2.com
    • Document Root: /home/domain1/domains/domain2/public_html
  • Edit the directives of the domain2 virtual server to match domain1:
    • Before: /home/domain1/domains/domain2/public_html
    • After: /home/domain1/public_html



Subscribe to Steven McMurry RSS