Drupal multi-sites

On the server end, you can configure Drupal so that multiple sites can run using the same code base (i.e. referencing the same Drupal core, module, theme, and library code). Because there’s only one copy of the code that all the sites use, it reduces the number of updates you have to do to maintain the sites. In contrast, if you were to run each site independently, you would need to apply every Drupal core and module update to each site’s code base.

Drupal multi-site setups do have some downsides. If something goes wrong with a Drupal core or module update (e.g. if a module update introduces a new bug), it can potentially take down all the sites on the multi-site installation at once. If you do set up a multi-site, it’s best to have one person in charge of doing updates and coordinating with all the individual site admins about when those updates will take place.

Most hosting environments are compatible with multi-site installations, but Pantheon is not. (Their pricing model is on a per-site basis, and you can’t run multiple sites using the same code base to save money.)

Setting up a multi-site isn’t difficult, as such, but it involves many steps that can be a little finicky, and seemingly minor errors can make it fail to work. An intrepid, non-technical person could do it, if you’re up for following directions exactly, not getting flustered if things go wrong, and Googling error messages if it doesn’t work. If that sort of troubleshooting doesn’t appeal to you, it might be better to enlist the help of someone more comfortable with working with servers. Here’s a high-level view of the process of setting up a multi-site. See this page for a more detailed guide to configuring a multi-site installation on inexpensive shared hosting using CPanel, with links to instructions for other kinds of hosting environments:

  1. Install and configure Drupal as normal for your first site. The settings.php file and the “files” folder for your first site will be in the sites/default folder.
  2. Do some server configuration to map the domain name for your second site to the Drupal folder you used for your first site. (This will vary depending on how your server is set up.)
  3. For your second site, create a new folder for it in the “sites” folder. The folder can be named anything, but let’s use the URL of the second site. (If your second site is mysecondproject.org, create a folder mysecondproject.org.)
  4. Create a new database for your second site
  5. Make a copy of the settings.php file that you used for your first site, and put it in the folder for your second site. Edit it to replace the first site’s database name, username and password with the corresponding info for your second sites.
  6. Make a copy of the example.sites.php file in the “sites” folder and rename it sites.php. Add a line: $sites[‘mysecondproject.org'] = ‘mysecondproject.org’;
  7. Go to mysecondproject.org/install.php and proceed with the installation.