Video tutorials

Install Platforms and Sites with Aegir Drupal Hosting System

Following up on Aegir installation tutorial, we'll actually be using Aegir, starting with creating platforms and sites. We'll explore both methods of setting up platforms: manually and using drush make.

Watch the Screencast

Tutorial In a Nutshell

Configure Aegir hosting options

When you first install Aegir, make sure that the task queues are running at admin/hosting/queues (use the top menu toolbar to navigate around the site).

Hosting Queue

Then go to Hosting->Features to enable Hosting Queue and other options as needed.

Aegir Hosting Features

Aegir Overview

There're three main components to Aegir:

  • Servers - web (currently Apache, nginx) and database (MySQL, pgSQL, etc.)
  • Platforms - the actual Drupal installation, such as Pressflow or Drupal 7
  • Sites - anything that lives in sites/ directory

After the initial installation, Aegir will have one (sometimes two) server with local web server and database (Apache2 and MySQL in this example), one platform called hostmaster with one site (called localhost in this example, but it can have a different name on a VPS). It's a special distribution of Drupal that provides front end for Aegir administration.

You can see all the servers, platforms and sites you manage clicking on the convenient links in the primary menu (top right corner). The site name link will take you to the site administration page with information and available tasks. I recommend running Verify if it hasn't run yet.

Aegir site admin screen

Setting up platforms manually

You can use two methods to create platforms where your sites would be hosted: manually on the server or using drush make. Let's use the manual method first.

Open the terminal and become the aegir user.

su -s /bin/bash aegir

If you're using local server, you might need to become root first (sudo -i).

Got to aegir home directory (/var/aegir). It should already have platforms directory so change to it. It's going to be empty for now. You can use drush to download core.

drush dl -drupal

Download platform manually

To create a platform, go to Content Management->Create content->Platform. Give it a name (ex: Drupal 7). For the publish path, enter the path to the drupal installation you've just downloaded (/var/aegir/platforms/drupal-7.8). Save the platform.

Enter platform information

A new verify task would appear in Queues. Wait for it to finish running.

If you now go to drupal-7.8 directory, you'll see it's not different from the regular Drupal installation except for a file that Provision has added called drushrc.php.

Platform directory after verifying

If you read it, you'll see a long list of arrays describing the platforms (modules, themes, etc.) If you cd to sites directory, there won't be any sites installed yet. Don't install them manually because Aegir will do it for you.

Installing a site with Aegir

Go to Create Content->Site. Give it a name, then choose Install profile. Here's a tricky part: you need to choose the profile first and then you'll see any platforms where these profiles are available. However, the names of installation profiles have changed in Drupal 7. So in order to make the new Drupal 7 platform available, you need to choose Standard profile (or Minimal, or Testing).

We only have one database server right now. Note that there's no web server because you can only set it when creating a platform. Save the site.Install a new site

While you're waiting for the installation task to finish, you can add the new domain to your hosts files (/etc/hosts).

Open the new site page and click on Log in to your site link.

Go to your site

The first time you do it, you'll get a reset password page and then will be redirected to the admin user page where you can change the password. Congratulations: your Drupal 7 site is up and running!

If you now go back to the sites directory, the new site is going to be there. If you change to it and list the contents, you'll see files and other subdirectories.

Sites directory

Aegir has also added drushrc.php file where the site information (database, passwords, etc.) is stored (and not in settings.php). So if you need to add or override some settings, don't do it in settings.php. Check Aegir docs for sites overrides.

Using drush make to create a platform

I've created and uploaded a simple makefile that references Pressflow and a few other modules and themes. If you haven't used drush make before, you can get familiar with the documentation on

Platform makefile

Open Create Platform page, enter the name and the path to the makefile on the system. Once again, specify the path to the platform. Although it doesn't exist right now, Aegir is going to create it for us.

Create Platform

Once the platform verified, you can create a new site using it.Create a new site

Coming soon: how to use migrate, clone and other common site tasks.