This is part 3 in our series of pages on running WordPress on the cloud. In this page, we briefly review how to set up WordPress on the Microsoft Azure cloud and make it production ready. Also check out the previous parts of our series: Part 1: What it Means to Move WordPress to the Public Cloud and Part 2: Setting Up WordPress on Amazon EC2.
Source: Flickr, Justin Van Patten
Azure is Microsoft’s public cloud. It provides Infrastructure as a Service solutions like Amazon EC2, where you can rent computing power on demand, but also advanced Platform as a Service capabilities, allowing you to run applications and services on the cloud with Microsoft Azure configuring and managing different aspects behind the scenes.
Microsoft provides a 30 day free trial with a $200 allowance to spend on Azure cloud products. This should be enough to get started and see how the Microsoft Azure cloud works for your WordPress site.
However, setting up WordPress on Azure, making it production ready and scaling up requires technical expertise and can be prohibitively complex. In this page we'll discuss the complexities you can expect when taking your WordPress site to Azure, and how Pantheon's cloud-based enterprise WordPress hosting can help you get many of the same benefits without the complexity.
Setting Up a Basic WordPress App on Microsoft Azure
This involves creating a WordPress Web App using the web application gallery on Microsoft Azure, connecting to the third-party MySQL service recommended by Azure, ClearDB, and adding plugins required for stability.
The steps to create a free Microsoft Azure WordPress application are:
- Create a Microsoft Azure account.
- Create a new WordPress template from the Azure Portal.
- Define the WordPress app initially with the default MySQL database.
- Start the app and define the admin username and password.
For the full process and more details, see the Azure WordPress tutorial.
Making Your Microsoft Azure WordPress Site Production Ready
Switching to a third-party MySQL vendor: According to the Azure blog, the free MySQL database that comes with the WordPress template is not suitable for production use and can have very high latency. The Microsoft Azure team recommends using ClearDB, a third party vendor offering MySQL on Microsoft Azure which is production ready. Here is the Microsoft Azure documentation for setting up a ClearDB database on Azure. A few sources online have raised questions about the stability or ClearDB and some suggest integrating SQL on Azure for the WordPress database.
Customizing WordPress for use in Microsoft Azure: The Azure blog recommends adding the following plugins to ensure your WordPress site works well in the Microsoft Azure environment: WP-Optimize, Azure Storage Plugin (to store your content to Microsoft Azure storage instead of the uploads directory), Smush.it for image compression, WordPress Minify, and turning off trackbacks and pingbacks. Also, Microsoft Azure does not support mod.rewrite, a common method to perform URL rewriting and redirections in PHP applications, so you will need to do this using the IIS URL Rewrite module. In addition, to improve stability with the ClearDB database, you will need to install the Persistent Database Connection Updater plugin, developed specifically to create a smoother connection between WordPress and ClearDB on Microsoft Azure.
Setting up SSL: To configure HTTPS for your web app in Microsoft Azure, you’ll need to obtain an SSL certificate in one of three ways: using a command line Windows utility called Cetreq.exe, using OpenSSL from a terminal session, or using the IIS Manager. After obtaining a certificate, you’ll need to configure your pricing tier for SSL, configure SSL in your app, and then optionally enforce SSL use in your app. For more details, see the Enabling HTTPS section in the Azure Documentation.
Auto-scaling: To ensure your WordPress site can scale up on demand when traffic increases, you will need to predefine a number of virtual machines with WordPress installed and configuring them as an Availability Set, with a set of rules to trigger scaling from one to additional virtual machines. Read more about the process in this post by Kirk Evans on MSDN. A simpler option is to set up a Scalable WordPress instance, which runs on only one virtual machine, but stores files on a separate Microsoft Azure storage account, as explained on StackOverflow.
Costs: Running your WordPress site in the Basic Tier in Microsoft Azure with 1 dedicated CPU core, 1.75GB RAM and 10GB storage, together with the ClearDB MySQL database, will cost around $66 per month (estimated by Scott Ge based on his experience setting up WordPress in Microsoft Azure). Another cost estimate by Scott Hanselman (from 2013) claims that if you can pack several websites into one Microsoft Azure account, you can get to a cost of $10-15 per month, excluding the cost of the ClearBit database.
WordPress on the Cloud—How Pantheon Can Help
Pantheon is an enterprise-grade WordPress hosting service that runs on the public cloud. Using the power of the cloud, Pantheon can scale you from a tiny site with no traffic to “internet famous” in seconds. We do it with an automated container-based platform that runs on “bare metal” cloud infrastructure, and is an order of magnitude faster than the traditional virtualized cloud machine instances, like the ones you get on Microsoft Azure.
Instead of having to work hard to get WordPress to a production-ready state on Microsoft Azure as we described above, on Pantheon you can get a production-grade database, an optimized WordPress installation, caching and auto-scaling—all tested and working out of the box at the click of a button. Also, you’ll get immediate access to advanced DevOps and workflow automation features, so you can develop like the pros, as if you were on your own local server.
GET WORDPRESS ON THE CLOUD WITH NONE OF THE COMPLEXITY
GET WORDPRESS ON THE CLOUD WITH NONE OF THE COMPLEXITY
Try Pantheon for free to experience the power of auto-scaling on the cloud, unmatched performance, security and other enterprise features, including a modern, collaborative development workflow.
Next Up in this Series
Learn how to set up WordPress on more public clouds: