How to configure a Drupal multisite setup

One of the core features of Drupal is the ability to run a multisite setup. That means that you can run multiple websites from the same code base. The advantage is that is makes upgrading the core and contributed modules a lot easier and faster, as you just have to upgrade once, rather than multiple times.

There is a lot of information available on how to setup a Drupal multisite. I have read a lot of it, and most of it is very confusing. I have followed many “tutorials” and ended up going around in circles. This morning I finally figured out how to do it, and it is actually very easy if you do not try and over complicate it!

Step by Step Tutorial

I am assuming that you have access to cPanel and phpMyAdmin. If you run Plesk or similar, then this should still work fine for you. This tutorial is based on Drupal 5.7 (but should work with other versions)

These steps will create one primary site and then additional secondary sites. The secondary sites will all run as their own sites with their own themes, and can have their own standalone modules if required.

  1. Setup the primary site as a standard Drupal installation. I will assume the primary site is called Create a folder called "modules" in the sites/all folder. Put any contributed modules that you want to install for all of your multi sites in that folder (sites/all/modules). The acutal modules folder that is in the root should only have the core Drupal modules.
  2. In the sites folder, create a folder with the domain name of your first additional secondary site. I will assume this is called So the directory path will be sites/ It is important that you name the folder the full domain name and not just example2
  3. FTP the settings.php file from sites/default to your local machine. Then FTP it to sites/
  4. Create a folder in sites/ called "modules". This is where you will put any modules that are to be just for Note that any modules that are to be used by all sites can go into sites/all/modules.
  5. Create a folder in sites/ called "themes". You can put any themes that relate to here.
  6. Create a folder in sites/ called "files". Change the permissions to "777"
  7. In the cPanel, create a database for Add the database user (the one used for the primary site) to and give it all privileges.
  8. Now we are going to load the database with all the tables needed. I have created a dump of that for you already. Download the dump from the bottom of this tutorial and save it locally. Open it in a good code editor. Go to phpMyadmin and go to the database that you just created. Go to "SQL" and then copy and paste all of the code from the SQL dump into there. Click "Go" and hey presto, your database it ready!
  9. Now, go to the settings.php file for This is in sites/ Scroll down until you see this line:
    $db_url = 'mysql://username:password@localhost/databasename';
    Change the database name so that it is the name of the database that you just created for
  10. You now need to point to your web server. So go to the place that you registered the domain name (the registrar) and change the name servers to point to your web server.
  11. You can now "park" that domain on top of your primary domain. This is the stage that a lot of people get stuck on. You will see a lot of people suggesting using a Symlink. This can get very confusing and complicated. Parking is much simpler. Go to your cPanel. Click on "Parked Domains". Add into the "New Domain Name" and click on "Add Domain".
  12. It may take a couple of hours (up to 24 hours) for your name server change to propagate through the internet, so you may want to grab a coffee now!
  13. Now, if you go to, you should get the standard "Welcome to your new Drupal website" screen. You can now create your first user for and set it up in the usual way.
  14. Repeat steps 2 to 13 for an additional sites
  15. When it comes to upgrading Drupal to a new version, you can perform the upgrade on your primary domain. You can also upgrade any contributed modules that are shared across all of your multiple domains in the sites/all/modules folder.

There, that wasn’t so hard! If I have left anything off or made any mistakes, please make a comment below and I will make the necessary changes to the tutorial.

UPDATE: The SQL file download does not work. So you can copy and paste the SQL code to create your tables from here: