Cloud-based services such as YouTube, Twitter, Survey Monkey, iCloud, Google Docs, and countless others provide software-as-a-service (SaaS) to clients on a network. While “the cloud” provides a diversity of services at unparalleled performance, the idea of a powerful computer delivering services to a client predates the Internet itself. Beyond the classic client-server architecture, today’s cloud offers redundancy, scalability, and high uptime. Amazon Web Services offers an excellent opportunity for an aspiring programmer or IT professional to explore the fundamental concepts of networking and server administration.
You are a Client on a Network
Even before the Department of Defense developed the ARPANET in the 60’s, a person would use a terminal to access a more powerful mainframe computer. In the 2010’s, our “terminals” (laptops and smart phones) are general purpose computers capable of billions of operations per second. However, we still retain large-scale facilities with immense computing resources, requiring skilled technicians and dedicated air conditioning: data centers.
Just as anyone can be a client on the Internet, anyone can be a server. You can power up that old Dell workstation, install Apache, and host a WordPress blog from your closet. Of course, you face issues such as intermittent downtime when you reboot your home router, not to mention the ever-present hazard of tripping over the power cable. This problem is solved by companies like Nexcess and Digital Ocean. These traditional web hosts offer an incredible bang for your buck.
Today’s post will focus on Amazon’s cloud offering, Amazon Web Services (AWS). What differentiates large cloud providers like AWS, Microsoft Azure, and Google App Engine is 1) their enormous scale, and 2) their ability to scale computing resources on-demand. For these reasons, these giants are sometimes referred to as infrastructure-as-a-service (IaaS) providers. Each provider maintains ample documentation about their differentiating features. For the purposes of an introduction, this post will focus on configuring an AWS instance as a basic web host.
Creating an Instance in the Amazon cloud
In 140 characters or less, “Create ‘free’ AWS account. Generate public and private keys. Add public key to the server. Use private key to log in. Mission accomplished.”
In the words of AWS, Getting Started with Amazon EC2
In further detail, we are using Amazon’s Elastic Compute Cloud (EC2) service. The “free” account has a few requirements.
- Email address
- Credit card number
- Phone number, which you are required to verify
When experimenting, I was never charged more than 40 cents a month. Nevertheless, I recommend using a prepaid credit card, like a Visa gift card. This places a hard limit on how much you can spend, avoiding any unintended fees. This provides a welcome security blanket as we explore the various settings of our Amazon cloud instance.
After creating an account, you are welcomed to an account portal. You will notice many AWS offerings, such as their S3 storage solution. Today, are focused on EC2, the Elastic Compute Cloud.
When creating an EC2 instance, there are a few operating system choices: Ubuntu, CentOS, and the “Amazon Machine Image,” a Linux distribution based on Red Hat. Paid versions also offer Microsoft operating systems. For today’s purposes, we will use Ubuntu, though I would also recommend CentOS, due to Red Hat’s dominance in Enterprise settings.
There are a few other basic settings like storage and CPU speed. For learning, the smallest free options work great.
Using Keys to Authenticate Yourself
“Public-key cryptography, or asymmetric cryptography, is any cryptographic system that uses pairs of keys: public keys that may be disseminated widely paired with private keys which are known only to the owner. See Public-key cryptography on Wikipedia for a bit more on this.
Explaining public-key crypto in all its wonderful detail is beyond the scope of this post. Suffice to say, it is the technology enabling HTTPS, GPG-encrypted email, and a common method of logging into servers. Public-key crypto is not difficult to grasp in concept, but can often be frustrating because, well, you are locked out! Just as an adversary without your key cannot log in, you are just as helpless without the proper configuration. If you are unfamiliar, as I was, to authenticating using an SSH key, please see the thorough documentation provided by AWS.
One note of caution, Amazon technically bends the rules. No one but you should ever have access to your private key. That’s why it’s called a private key. Amazon smooths out the process by generating the keypair (the public and private keys always come in pairs) which the user downloads … but that means Amazon saw the private key! This is not a standard practice. The standard practice is to generate your own public and private keys, copy and share the public key, and always keep the private key secret.
If you have accessed your instance via the command line, congratulations. You have successfully configured your Amazon Elastic Compute Cloud instance.
Basic Installation and Configuration of Magento
Now that you have SSH access to your Amazon cloud instance, from a software perspective, there is nothing really different from the Dell workstation running a web server in your closet. You have introduced complexity by running on Amazon’s infrastructure, but now we have risen to a level of abstraction where general Ubuntu guides will be helpful, even if they are not tailored to Amazon Web Services.
- Ubuntu: Installing Required Prerequisite Software for Magento CE 1.8 Magento EE 1.13 (or Later). Set up the AMP portion of the LAMP stack (Linux, Apache, MySQL, PHP). This is basic configuration of a web application in general, not just Magento. A good first goal is to setup Apache so that the default home page is accessible from your browser.
- Installing and Verifying Magento Community Edition (CE) and Enterprise Edition (EE). There are some “gotchas” along the way, including correct configuration of MySQL. Don’t worry if it doesn’t work the first time. Start over, and read the instructions very carefully. If you get error messages, search for the exact messages and see what Google and Stack Overflow have to say. You can do it!
- New AWS Quick Start – Magento for E-Commerce. From the AWS blog. I haven’t followed this tutorial personally, but it looks pretty thorough.
A New Offering from Magento
In April at the 2016 International Magento Imagine conference, Magento announced their new Magento Enterprise Cloud Edition, a platform-as-a-service offering that utilizes AWS and enables rapid deployment of fully customizable, secure, and scalable web storefronts. Combined with a managed services infrastructure, Magento Enterprise Cloud Edition takes advantage of the Magento Enterprise 2.0.5 platform, and with the AWS hosting infrastructure, provides a new level of redundancy that will deliver performance, stability and elastic scalability. All the details for this new offering haven’t been released yet, including pricing for this type of license, so we’ll be releasing more details about it as we learn more, and we start working with it. Check back soon for more on this from our team.
There is no cloud, just someone else’s data center. Anyone can host a web server, but hosting companies do it best. Infrastructure-as-a-service providers like Amazon, Google, and Microsoft push the limits of web hosting by including redundant storage, on-demand scaling, and unprecedented reliability. Experimenting with a free AWS account provides a great opportunity to learn about web hosting, installing Magento, and the Internet itself.
I’ll close by quoting our office’s Welcome mat. Always remember: “There’s no place like 127.0.0.1.”