This version of the doc is no longer supported. Please check out the stable docs for the latest in Juju.

Using Juju to Deploy Drupal Windows Charm

Juju is able to deploy workloads on top of Windows. For the moment, only MAAS and OpenStack can be used as providers, but shortly in the future, Juju will be able to deploy Windows workloads using any provider, starting from private clouds to public clouds.

This tutorial explains how to deploy Drupal Windows charm on top of IIS (Internet Information Services) with HAProxy used as reverse proxy.

Before anything else, make sure you have a MAAS or an OpenStack environment with Windows images uploaded to it (Windows Server 2012 R2 is used in this tutorial). Cloudbase has a wiki page with a step-by-step tutorial on how to create a MAAS environment with Windows images. Also, ensure that Juju is properly installed and configured. You can visit Getting Started section to get instructions on that.

Basic Usage of the Drupal IIS Charm

First, make sure you bootstrapped an environment. If you have not already, do so:

juju bootstrap

Create a basic configuration file drupal-iis.yaml to add info about your Drupal site:

drupal-iis:
  site-name: "Drupal IIS Web Site"
  site-mail: "admin@admin.com"
  admin-password: "Passw0rd"
  admin-mail: "admin@admin.com"

Drupal content management system uses a relational database to store its data. The Drupal Windows charm supports the relation with the following database charms: mysql, postgresql and mssql-express.

The charm is agnostic of which database you choose. For this tutorial we will use the mssql-express database charm, but you are free to choose any of the supported ones and it will behave the same.

Deploy the Drupal Windows charm with the custom yaml config file you prepared and the mssql-express database charm:

juju deploy cs:~cloudbaseit/win2012r2/drupal-iis --config drupal-iis.yaml
juju deploy cs:~cloudbaseit/win2012r2/mssql-express

Wait until the deployment of charms finishes, then add a relation between them:

juju add-relation drupal-iis mssql-express

At this point, you have a basic deployment of Drupal content management system that uses two Microsoft technologies: IIS web server and MSSQL Express relational database.

juju-gui-services

Next, find the public address of the Drupal unit you just deployed by issuing the following command:

juju status drupal-iis

Open a web browser and visit http://<public_address>/ and you should be able to see the home page of your Drupal website.

Drupal Home Page

Now you can scale out horizontally with:

juju add-unit drupal-iis

and scale down with:

juju remove-unit drupal-iis/<unit_number>

To add a reverse proxy you can use the HAProxy charm and distribute connections from one front-end port to your charm units.

juju deploy haproxy
juju add-relation haproxy drupal-iis
juju expose haproxy

juju-gui-haproxy

And then get the public address from the haproxy instead:

juju status haproxy

and when you visit http://<public_address>/ you should see the same home page of your Drupal website.

Charm configuration

Configurable aspects of the charm are listed in config.yaml with detailed description about each one. You either edit the default values directly in the yaml file or pass a drupal-iis.yaml configuration file at the deployment as previously described.

If there is a Drupal service already deployed, you can define the new configs for your website in custom drupal-iis.yaml file and after executing:

juju set drupal-iis --config drupal-iis.yaml

the charm will respond accordingly and it will reconfigure.