Moving a WordPress Blog to Windows Azure – Part 3: Setting Up Your Custom Domain
In Part 1, we discussed how to stand-up a WordPress website in Windows Azure. In Part 2, I outlined the steps to export your content from your old WordPress website to the new one hosted in Windows Azure. In this article, we’ll walkthrough the steps to setup up your custom domain for your new Windows Azure Website.
When you first create your website in Windows Azure, it is hosted under a domain that’s great for testing but not great for “production”. What we want is to go from http://<mysite>.azurewebsites.net to http://<mysite>. We can do this in Windows Azure by configuring a custom domain.
To use a custom domain in Windows Azure Websites, your website must be configured to run in Shared or Standard mode. Note, that running in Shared or Standard does incur a cost which our outlined on the Windows Azure Pricing page. However, as I stated in previous articles, MSDN Subscribers and BizSpark members are afforded various benefits including price reductions across the various Windows Azure Services.
The steps to setting up your custom domain include:
1.) Configure your web site for shared or standard mode
2.) Configure the CNAME with your domain registrar (ie. GoDaddy, Hover, etc.)
3.) Set the domain name in the Windows Azure management portal
These instructions are outlined in the article, Configuring a custom domain for a Windows Azure web site.
Configure your web site for shared or standard mode
Starting with Step 1, login to your Windows Azure Portal and open the dashboard for your WordPress site. From there, click on the SCALE menu item and select the appropriate WEB SITE MODE: SHARED or STANDARD. (NOTE: You will start incurring the relevant charges once you select either of these modes. Pricing details can be found here.)
Once the Web Site Mode is selected, click the Save button on the task bar at the bottom of the page.
Configure the CNAME with your domain registrar
This next step will vary based on who your domain registrar is. Your domain registrar maintains the records for your domain. Most importantly, it maintains the instructions of where to send people when they type in your domain. More likely than not, your domain registrar is the place where you bought your domain. For my domain, davebost.com, my registrar is GoDaddy. I’m in the process of moving all of my domains over to Hover but I haven’t had the chance to move davebost.com just yet.
Log on to your domain registrar’s site. Find where you manage the DNS entries for your domain and create a CNAME for your domain that maps back to your azurewebsites.net site.
For GoDaddy, open the management page (Domain Details) for your custom domain and select the “DNS Zone File” tab.
For my site, my hosting provider was maintaining my Nameservers along with all my CNAME and A records. To switch completely away from my hosting company, I had to set my Nameservers back to GoDaddy’s servers by selecting ‘Manage’ under ‘Nameservers’ and selecting the ‘Standard’ setup type.
Now click on the “DNS Zone File” tab to manage your DNS entries.
We’ll want people to navigate to our website whether they enter using the ‘www’ alias (http://www.yoursite.com) or without (http://yoursite.com). For Windows Azure Websites, we need to add an additional CNAME item to handle a required verification process that we’ll come across in Step 2.
With this in mind, add the following CNAME entries:
|Alias||Points To (Value)||TTL|
To handle the ability to navigate to your site without the ‘www’ alias, you will need to create an A Record with your domain registrar. An A Record will map traffic to a public IP address versus redirecting to a domain. Therefore, you will need to know your new Windows Azure website public IP address.
To get your websites public IP address, open the Windows Azure portal page for your website. On the task bar at the bottom, select ‘Manage Domains’.
On the Mange custom domains page, your public IP address is listed towards the bottom:
Switch back to the domain registrar’s DNS management page and create an A Record that points to your Public IP address, in this example we’ll use 10.10.10.10.
|Alias||Points To (Value)||TTL|
After my changes and additions, my DNS entries include the following:
Set the domain name in the Windows Azure management portal
Once your CNAMES have been propagated with your domain registrar, you can add your domain names to your Windows Azure Website.
Note: Your domain name should be valid as we are moving an existing site over to a new host. However, the domain name may not redirect to the proper address until the DNS change propagates across the Internet. Check with your domain registrar’s policy for the expected turnaround time. There are several factors involved for how long the DNS propagation it will take.
Open the Windows Azure Management Portal. Click on the Web Sites tab, click the name of your website. From there, click on the Dashboard tab to open your websites dashboard page.
As we did in the step to retrieve our public IP address, click on the Manage Domains button on the task bar.
Add an entry for both your ‘www’ aliased domain and your root domain.
Windows Azure will validate the existence of the host name before it will save the changes. In the case of our A Record (http://davebost.com), the verification process will check against the awverify.<yoursite>.azurewebsites.net CNAME item we created earlier. Our ‘www’ address is verified against the ‘www’ CNAME record.
Click the check mark to save the changes.
Once your domain registrar propagates the changes across the Internet, you’ll be up and running with your custom domain!
In the next step, we’ll cover how to handle custom permalinks with a server-side configuration file.