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)

Setting up a server


Now we are ready to move from questions about what a multi-site is to the actual setup and configuration of a multi-site server. Here, we will be creating an environment that, in the next chapter, will run our Drupal-based multi-site.

The first thing we will need is a server. You may choose to use your local computer as a temporary server. Or you may use a server provided by an Internet Service Provider (ISP). Or you can use a separate dedicated piece of hardware. But for our purposes, we will be creating what is called a virtual server—a complete operating system that runs inside of our current operating system. This server will run its own Linux operating system.

As we configure things below, we will be using Apache on Ubuntu Linux. While Apache configurations work essentially the same on all platforms, different operating systems and distributions organize the files in their own ways. You may wish to consult your operating system's documentation to learn about these differences.

Note

If you are running your sites on a shared-hosting or managed-hosting platform, chances are that you will not need to configure Apache. Instead, you should work with your hosting provider to set up virtual hosting.

In what is left of this chapter, we will focus on creating an environment in which to run our Drupal multi-site. I am going to walk through two ways of doing this:

  • First, we can install a virtual machine pre-configured for this book. We do this with the open source VirtualBox and Vagrant tools, along with a custom Drupal Vagrant profile. This route is great for testing things out on your local workstation. It is a great way of building "disposable" sites that we can develop with. They can be created and deleted without impacting your local "host" computer. It's like having your own personal development server(s), but without the hardware cost.

  • Second, we can begin with an established server running Apache, MySQL, and PHP. From there, we can just focus on tuning Apache and creating a few MySQL databases. Note, though, that this route will require you to handle getting the rest of the server configured. However, if you are hosting your sites on a managed service provider or shared hosting account, your hosting provider will probably do all of this for you at your request.

In the next section we will look at the VirtualBox and Vagrant method for running a development environment locally. If this is not to your taste, you can skip and move ahead.