Microsoft Azure is the next big thing in cloud computing. Azure is basically a cloud computing service provided by Microsoft that can be used to build, deploy and manage applications through a network of Microsoft-owned datacentres. It is basically a collection of around 68 products that include virtual machines, SQL Database, App Service and others. Azure is a complete set of solutions that you’ll need while deploying web applications and virtual machines.
Run WordPress on Microsoft Azure
Recently I attended an event in Chandigarh, India organized by WordPress Chandigarh and Microsoft User Group – Chandigarh. The event’s title was – How to run blazingly fast WordPress on Microsoft Azure. We discussed various possibilities for using Microsoft Azure to deploy websites and WordPress. And the facilitator of the day, Mr. Jasjit Chopra shared his knowledge and conducted a workshop on running a WordPress website on Microsoft Azure. In this post, I’ve tried my best to summarize the workshop and provide you relevant steps on running WordPress on Azure.
Benefits of hosting WordPress on Microsoft Azure
We usually host our websites on Shared Hosting where the cost is less but at the same time speed and security sometimes are also compromised. We discussed the possibilities of using cloud computing to host WordPress. A virtual server with solid state drive proved to be better than these conventional web hosting services. Although, the costs incurred might be larger in comparison. But you can host more than one website and make sure they load at fastest possible speed. Providing a solid-state drive and top notch hardware capabilities of Azure, WordPress can run blazingly fast.
In this entire post and our workshop, we used a free Dev Essential account for accessing Microsoft Azure. As you sign up you get a free 300$ Azure Credit over a span of a year (25$ a month). This much credit is more than sufficient for you to try out Azure and deploy your testing website.
So basically, all the tools and services that we are going to use in this tutorial are free of cost. And you need to pay only when you are actually building something for your enterprise. The free credit can facilitate your testing projects.
The tutorial is divided into two parts, the first one discusses the Azure sign-up process and creating a virtual server. The second part talks about setting up and configuring your server to host WordPress.
Setting up Azure
Step 1: Head over to Microsoft Dev Essentials website here. Complete the sign-up process to receive your free credit. Now head over to the Azure website and log in using your credentials, now you have a fully functional Azure account that can be used to deploy applications.
Step 1 (Alternate): There is an alternative available if you don’t wish to sign up using Dev Essentials. You can directly go the Azure website and start a free trial that offers you free 200$ credit for a period of one month.
Step 2: Now we need to create a Virtual Machine, that would run our server. We’ve used Ubuntu 14.04 LTS for deploying a server. You are free to use other versions or even Windows to deploy the server.
To create a new virtual machine, hit the green plus icon from the Azure dashboard. Now search for ‘Ubuntu Server 14.04 LTS’ and hit ‘Enter’. Select the relevant option from the search results and choose ‘Resource Manager’ as the deployment model. Hit the Create button. You may click on the images to see the larger version.
Step 3: Now we need to do some configuration in order to set up our virtual machine. Follow these steps carefully to avoid any validation errors. Choose a name for the machine and then select the VM disk type as ‘SSD’. You need to choose it as an SSD so that your server performs a lot faster than the conventional web hosts.
Our goal in the entire tutorial is to make the WordPress installation perform faster in the backend so an SSD is a must. Now choose a username and change the authentication type to ‘Password’. Create a strong enough password and make sure you remember the username and password.
Now select ‘Create new’ under the Resource Group and select an appropriate name for it. Usually, the name starts with ‘RG’ followed by the name of your virtual machine. Then choose a location that is closest to you and available to you in the free account. We choose the closest location to decrease latency and improve speed. Hit ‘OK’ when you are done.
Step 4: Now in this step, you need to choose the size of the virtual machine. The size is completely dependent on the requirement of your project. We recommend DS1_V2 for this tutorial and for hosting your other common projects and you can easily scale up as your organization grows and you encounter more traffic on your website. Easy scaling is the beauty of Microsoft Azure. DS1_V2 comes with a single core processor, 3.5 GB RAM and 7 GB of SSD Disk space and it can cost somewhere around 60$ per month if you are using a server somewhere near Southeast Asia.
You don’t need to pay the cost as you already have the free credits, obtained in Step 1. Select the appropriate size and hit ‘Select’.
Step 5: This is the most crucial step where we configure some optional settings. Here you can choose the name of your storage account. Also, you can configure the Public IP of your virtual machine. The IP can be dynamic or static as per your requirement. We are using dynamic for this tutorial. Furthermore, we need to create a new inbound rule in the ‘Network Security Group Firewall’. We create this rule so that our machine can listen over port 80 and serve the website’s content.
To add this rule, select NSG from the menu and then under ‘Inbound Rules’ hit ‘Add an inbound rule’. Follow the following configuration to setup this rule:
- Name: “http”
- Priority: Any integer greater than SSH’s priority (>1000)
- Service: “HTTP”
- Port: 80 (Default)
- Protocol: “TCP” (Default)
- Action: Allow
Hit all the ‘OK’ buttons to create the rule and save the settings. And you’ve successfully configured up your virtual machine that is capable of communicating with other computers over the port 80.
Step 6: Now Azure will run a validation on the machine to make sure you’ve configured it properly and there are no errors. If the validation passes with all the green flags, you can finally deploy your machine by hitting the ‘OK’ button. Now it will take up to a few minutes to complete the deployment. And if in any case, the deployment fails, you can delete the entire resource group and repeat the process or discuss with us in the comment section below.
You will now be able to see your virtual machine running. In the next part of the post – How to install & setup WordPress on Microsoft Azure – we’ve discussed on how to connect to this machine and install and host WordPress on it.