Running Drupal on AWS using Zend Server

      No Comments on Running Drupal on AWS using Zend Server

In this post I’m going to walk you through the steps for creating a new development environment consisting of a Drupal application running on AWS. I’m going to use an EC2 instance with Zend Server and RDS to handle the database part, and the AWS networking functionality to handle networking. First, I’m going to launch a Zend Server instance using the AWS marketplace, which is the easiest way to run a bulletproof, tested and scalable PHP environment on AWS, with the added ability to deploy a Drupal application and many other popular CMS in a just few minutes.

Launching your Drupal on AWS Instance

First, we’re going to launch a new instance.

Log into your AWS account and select the EC2 service. In the EC2 console, in the menu on the left, click on “Instances”, and then click on the “Launch Instance” button. Then, go to the “AWS Marketplace” tab and select “PHP 5.6 – Zend Server Professional Edition (Ubuntu)”.

Complete the instance launch wizard. This wizard will take you through the process of launching an EC2 instance from a blueprint that is provided by Zend and Amazon. You will see the pricing for every instance type- select the instance type that you want to use and configure the instance details, such as  the number of instances, the network setup and the subnet.

Please wait for the instance to finish the initialization process.

After the initialization process is over, you can access Zend Server using the public DNS of your instance which can be found on the EC2 console, on port 10081 (e.g. http://ec2-52-3-133-243.compute-1.amazonaws.com:10081/).

For security reasons, the first time you access Zend server, you will need to enter your instance ID (which can also be obtained from the EC2 console) as your initial username and password.

Choose the relevant settings in the Zend Server launching wizard and launch Zend Server.

Deploy Drupal on Zend Server

Now, you should be seeing the Zend Server Getting Started page.

In the “DEPLOY SAMPLE APPS” section, click on Drupal. 

If you already have an RDS or any other MySQL that you can use for your Drupal application and it’s accessible, you can go on with the deployment wizard and skip the next section. If not, you need to create one.

Create a database using RDS

This step describes how to use RDS as the MySQL server instance for Drupal on AWS.

RDS is the Relational Database Service that AWS provides. This is a fully managed database instance managed by AWS and is very easy to setup, scale and operate. An AWS RDS is also easy to resize and the price is pretty low and depends on the amount of load and the size of the database.

Go to the AWS main console and select RDS, under the “Database” section.

Click on the “Get Start Now” button, select MySQL as your engine and when you get to a stage where you need to select a security group select “PHP 5-6 – Zend Server Professional Edition…”

Make sure you have the right security group permission for the Zend Server instance to access your RDS instance.

For example, in the RDS dashboard, click on the “Security Groups”, on the connection type choose “EC2 Security Group” and on the “EC2 Security Group Name” choose “PHP 5.6 – Zend Server Enterprise Edition (Ubuntu)”.

You also have to add the MySQL port on your security group. Go to the EC2 console, on the left menu choose “Security Groups”, click (select) on “PHP 5-6 – Zend Server Professional…” and then click on “Actions” and select “Edit inbound rules”. Now, click on “Add Rule” and from the drop-down select “MYSQL/Aurora”. Click on save and you are ready to go.

Finalizing the installation

After your have your MySQL and network setup, you can finish the Drupal deployment using the Zend Server deployment wizard and the details that you’ve defined in the previous steps.

For more details about applications deployment, see: http://files.zend.com/help/Zend-Server/content/deploying_an_application.htm

You should be able to access your Drupal application on http://ec2-52-3-133-243.compute-1.amazonaws.com if you choose to install in on the root URL.

Summary

Zend Server provides you with a fully managed and tested PHP environment that is very easy to scale and deploy on any cloud. AWS is one of the best places to run a production environment and the combination between Zend Server platform and the AWS platform makes this the ultimate solution for any PHP application that needs to provide high quality service for users. Additionally, Zend Server provides a very easy way to duplicate your setup and you can also use the Zend CloudFormation Template generator to create an automatic scaling, high availability rig with minimum time and costs.

The CloudFormation template generator is located in http://www.zend.com/en/products/server/cloudformation