Deploying Drupal 7 to the cloud using the Windows Azure Companion

Author: Jas Sandhu

Date: Monday, January 24, 2011, 12:00:00 AM

Tags:

Table of Contents

IMPORTANT NOTE - July 13, 2011

The Windows Azure Companion was an experimental tool to provide a simple experience installing and configuring platform-elements (PHP runtime, extensions) and web applications on Windows Azure. Preliminary feedback on this tool has informed the creation of a new set of tools to deploy applications to Windows Azure - available at http://azurephp.interopbridges.com/downloads

-----------------------------------------------------------------------------------------------------
THE FOLLOWING CONTENT IS NO LONGER CURRENT. REFER TO THE LINK IN NOTE ABOVE

;

Updated: 01/28/11 - Added Post Install Configuration

Recommended pre-read

clip_image001+ clip_image002

Drupal 7 recently was released and I thought it would be a good idea to install in on our cloud services platform using the Windows Azure Companion to get a Drupal 7 instance out to the cloud in a few easy steps and give an overview on the features available with this great Content Management tool and the Windows Azure platform.

Watch the video of this tutorial:
Installing Drupal 7 on Windows Azure with the Windows Azure App Companion Tool

Drupal7Install

Downloading the Windows Azure Companion

The Window Azure Companion is hosted on the MSDN Code Gallery, and when you visit the project site, and click the Downloads tab, you'll see the download options shown below (as of the December 2010 CTP)

clip_image003

There are different Virtual Machines (VMs) of a Windows Azure cloud service which you can quickly upload within a provisioned Azure account. If you don't have an Azure account, you can find the current available offers here . In the current (December 2010 CTP) downloads there are two small sized VMs with and without security (https). There is also the companion source so that you can assemble your own VM if you need a larger size or need to modify the underlying plumbing.

We will be using the VM prepackaged option (WindowsAzureCompanion-SmallVM-Dec2010CTP.zip). Click on the link and you will be given the following windows for you to accept the license and download.
Click on "I agree"
clip_image004

You will then get a "File Download" window, Click "Open"
clip_image005

You will then get a window with the status of the file download and you will see the "Internet Explorer Security" window asking you for permission to open the file. Click on "Allow"
clip_image006

A window showing the contents of a temporary folder, similar to the one below will open. In this window you may see the following files. The first is ServiceConfiguration.cscfg file which contains a service configuration XML document for the service and compiled code, in the WindowsAzureCompanion.cspkg file. There is also a .txt document with the License for the code. Click on "Extract all files"

clip_image007

You will then get the following window and enter in a path to a directory you will drop the files in. Enter in the path, in my case, "\TEMP" in the text field labeled "Files will be extracted to this folder", make sure the checkbox "Show extracted files when complete" is selected and click the "Extract" button
clip_image008

You'll then see the folder you picked open up in a new window with the files you saw earlier,
clip_image009

You will then want to provision a storage account configured on Windows Azure. If you do not have one, then you will need to set one up and the article "How to Create a Storage Account" on MSDN will help you get started.

Before you deploy the service to Windows Azure, a few modifications to the ServiceConfiguration.cscfg file are required to be done.

You will want to specify the your Windows Azure storage account, I have named mine "d7wacstorage" and I copy and pasted the key that I set up when I created the storage account from above. I have redacted it for security and left it as XXXXX below, please use your own. You will find this in the "Windows Azure Storage Account Details" section

   1: <!-- Windows Azure Storage Account Details. -->
   2: <Setting name="WindowsAzureStorageAccountName" value="d7wacstorage" />
   3: <Setting name="WindowsAzureStorageAccountKey" value="XXXXXX" />

You will also have to set up an admin account for accessing the Windows Azure Companion once it's running. You will find this in the section labeled "Admin user name, password and e-mail". We'll just a simple username "root" and a strong password (something that contains, letters, numbers and symbols on your keyboard) of your own choosing. Replace XXXX with yours

   1: <!-- Admin user name, password and e-mail. Please use a good username and strong password --
   2: <Setting name="AdminUserName" value="root" /
   3: <Setting name="AdminPassword" value="XXXXXXX" />

Next we will be specifying a feed that indicates what applications are available to be installed. For this example, we will be using a feed that Maarten Balliauw has made available, but you can generate your own following the Windows Azure Companion Feed Schema. You will find the appropriate to do this in the "Atom Feed for Product items to be installed" section as per below.

   1: <!-- Atom Feed for Product items to be installed. This URL should be internet addressable --
   2: <Setting name="ProductListXmlFeed" value="http://wazstorage.blob.core.windows.net/azurecompanion/default/WindowsAzureCompanionFeed.xml" />

Next, deploy your application to a new hosted service on your Azure account. If you need a refresher for this part, refer to the "To select a project and create a compute service" section of this walkthrough on MSDN, using the .cspkg we downloaded and the .cscfg file we just updated. Once it's deployed you can browse to it at port 8080 of whatever URL you specified when you set up the Azure hosted service (computing) instance. For my instance it's http://d7wacompanion.cloudapp.net:8080, but you will likely not be able to use the same one for uniqueness. There is a handy option to check the availability of names that are available to make it easier for you. Make sure that the service is running too Jfor this tutorial the link may not work for you as I may have suspended or deleted the service. The diagram below is a good visual indicator that your service is running, namely that your "AdminWebSite" is "Ready" (Green check mark next to it, rather than Yellow or Red).
clip_image010

You'll be greeted with a welcome message via an ASP.NET MVC application; that message, by the way, is configurable via the ApplicationDescription setting in the ServiceConfiguration.cscfg. Upon logging in (via the link in the upper right), you'll have access to the other functionality of the Windows Azure Companion as well.

clip_image011
clip_image012

Installing Drupal, and PHP!

Next we will be installing Drupal and since it runs on PHP, the companion is aware of that prerequisite and will pick it up too unless however the feed we use does not have it in the product list (ProductListXmlFeed). Click on to the Applications tab, which here includes Drupal along with some other popular Open Source PHP packages. Click on the "Drupal" checkbox and you'll also notice that "phpMyAdmin" (an open source management tool) will also get automatically checked. Click on the "Next" button to continue
clip_image013

The next screen prompts for some versioning information for Drupal along with similar requests for other prerequisites. I will be using Drupal 7, using the default paths and I will do so also for phpMyAdmin. Since this feed also requires the PHP runtime, the MySQL database and the PEAR repository, those prerequisites also come along. Keep all the defaults and click on the "Accept" button to continue (you will be accepting all the licenses of the product)

clip_image014

While the applications are installing, you'll see progress messages appear on the Admin tab of the Windows Azure Companion site. Those messages, by the way, are also recorded to the Windows Azure Storage account you configured in the .cscfg file.

clip_image015

Upon completion, the applications will show as installed and ready to launch.

clip_image016

clip_image017

Configuring MySQL for use with Drupal

We will now want to configure a database in MySQL, We will use the phpMyAdmin tool. Click on the "Launch" button. clip_image017[1]

On the next screen use " " as the Server, "root" for the Username and "adminadmin" for the Password.

clip_image018

You'll next see the dashboard. We'll first change the password for security. Click on "Change password"
clip_image019

I recommend a strong password (something that contains letters, numbers and keyboard symbols) but somewhat easy to remember

clip_image020

You will get a message, "The profile has been updated". Click on the "Back" link to continue

clip_image021

You will need to login again using your new password. In the dash, in "Create new database", enter in the name of your preferred database, I am calling mine "Drupal7". Next click the "Create" button.

clip_image022

Configuring Drupal 7

Let's configure Drupal 7, go back to the browser window with the Windows Platform Companion dashboard and click on the "Launch button" for Drupal.

clip_image023

At this point we will want to configure Drupal. Simply just make sure the "Standard" dialog button is selected and click on "Save and continue"
clip_image024

We only have one built-in language (there is an option for other languages via a link), click on "Save and continue"
clip_image025

Next we will want to set up the database we created earlier. For the "Database name" enter in "Drupal7" (or whatever you named your database instance). For the tutorial we will use "root" for the "Database username", although you may create another account appropriately, and enter in the "Database password" you chose for MySQL.

clip_image026

It will give you an indication of your installation via a status bar.
clip_image027

Enter in the required information including site name, email address, username, password and some other settings that are optional. Click "Save and continue".

clip_image028

If all is successful you will be presented with "Drupal installation complete" message and a message congratulating you! Click on the "Visit your new site" link, also accessible from http://[yourDrupal7installname].cloudapp.net/drupal/

clip_image029

On the home screen you will receive a Welcome Message where you can now start exploring Drupal 7, by adding new content, changing the structure, appearance, configuration and reports. You will also want to modify your account and add users. There is also a very useful "Help" link to get you started
clip_image030

For more information on Drupal 7 please visit, http://drupal.org

Post Install Configuration

There are a couple of configuration items you need to check when you first login to your Drupal account. Two of the default settings may need to be updated, though this step should not be necessary soon.

Click the "Configuration" link located on the Admin Bar.

clip_image031

Locate the "Public file system path" and "Temporary directory" textboxes and ensure there are not forward slashes (/). Because Azure is a Windows system all paths must contain back slashes (\).

clip_image032

Be sure to click "Save configuration"

Next we need to navigate to "Modules" located on the Admin bar. Scroll down the page until you find "Update Manager" and make sure it is checked. Without the Update Manager enabled you will not be able to install new extensions.

clip_image033

Remember to click "Save configuration"

Wrap Up

Drupal 7 and Window Azure Companion work really well together and now it's easy to get it deployed. You also have the opportunity of getting other of your favorite open source applications out on the cloud service. Please take some time to try them out and other content on

Please also check out the source code for the Windows Azure Companion, so check it out, add your own features, or contribute to the discussion on the MSDN Code Gallery.

What's next?

 
blog comments powered by Disqus

Related Content

No related content was found