Book Image

Drupal 7 Multi Sites Configuration

Book Image

Drupal 7 Multi Sites Configuration

Overview of this book

Drupal is one of the most powerful PHP Content Management Systems there is. However, why would you install a CMS for every site you build? With just one copy of Drupal you can host several sites. Drupal has long had multi-site support, and Drupal 7's support is even better than previous versions. Drupal 7 Multi-Sites Configuration will teach you how to host several websites on a single copy of Drupal. You will learn how to create different sites, each with its own domain, content, and theme. This valuable information will help you to save time by managing modules and sharing them across several sites as well as administering your sites all in one place.This book will show you how to configure a system for multi-site, and then install several sites on one copy of Drupal, all with their own domain name and database. Learn how to install and share modules and themes, configure Apache, PHP, and MySQL for multi-site, and then manage the site. Once your site system is successfully set up, discover some of the advanced configurations possible with Drupal multi-site, as well as how to upgrade and maintain your sites.
Table of Contents (11 chapters)

Creating the other sites


We spent a long time walking through the process of creating the books.local site. The good news is that the process for creating the other sites is the same. Rather than repeating the process in detail, we will look at the process again in summary form, this time doing two sites at once.

Recall that our remaining sites are cooks.local and looks.local, and that we have already created the databases cooks_local and looks_local, one for each site.

Let's begin, in the Drupal sites/ directory, we need to create two directories, cooks.local and looks.local.

Each directory needs a settings.php file. The easiest way to proceed is to copy the settings.php from books.local and change the database information:

$databases['default']['default'] = array(
'driver' => 'mysql',
'database' => 'cooks_local',
'username' => 'drupal',
'password' => 'secret',
'host' => 'localhost',
);

The lines that typically need changing are highlighted above. And these will need to be...