Drupal Multisite Configurations and Hosts

To sustain this free service, we receive affiliate commissions via some of our links. This doesn’t affect rankings. Our review process.

Looking for a good Drupal host?

If you need a solid, reliable website host to host your Drupal multisites, check out Dreamhost. Use promo code We Rock Your Web50 to get up to 50% off your hosting order.

How to Correctly Set up Drupal Multisite?

The ability for Drupal to run multiple sites from one account is a huge plus for admins that are deploying multiple Drupal installations. The simple reason for this is that all Drupal installations can be updated at once. Basically each additional domain “points” to the document root of your primary Drupal installation. All you need to do to update the files of each additional Drupal site is update the files in the root install once. Caution: Before deploying production sites in a multisite environment I urge you to read my notes on security below and updating multisite codebases.


Before proceeding with these multisite installations please note that it’s possible for malicious users of one site to access protected files of multisite installations if they are given the ability to run PHP code. For example, the normally protected settings.php file (which hides confidential database access information) of one multisite could be accessible by another by running the following PHP snippet:

$file = file ( 'sites/example.com/settings.php' );
foreach ($file as $key => $line) {
print $line;
print "

Therefore it is vital that you follow the below guidelines:

  • Only administrators of the multisites should have access to the PHP input format that would enable them to do this in the first place, and never give the owners uid = 1.
  • If you need PHP input for users, run each user’s php process as fast-cgi and only link their sites subdirectory from the primary installation.
  • It’s recommended that you use a Virtual Host setup to begin with. You can also set up chrooted Apache environments. A V-host will usually do this for you.

Individual settings and themes for each site

In addition, each site will have its own settings and themes. This is where the “sites” folder comes in. You place each additional multisite in the /sites directory as its own directory. For example, the domain example.com would be added in /sites/example.com. It will have its own settings.php file, and its own theme folder.

Separate databases for each site

In the settings.php file for each site you will enter the information for its respective database. This way, each multisite will run off its own database. In addition, each will have access to its own theme files.

Fully separated control for each multisite

Finally, when you log into example.com (multisite pointing to your primary domain), you will be able to select which modules it uses, which theme, and will have full control over its settings as if it were its own separate Drupal installation.

How to set all this up?

The key behind Drupal multisite installations is that your host must enable you to point your additional sites to your primary Drupal installation’s document root. This can be done via domain parking, symlinks and virtual hosts.

Multisite via parked domains

It is also possible to implement a multisite configuration by simply parking the multisite domain on top of your primary domain. This may in fact be the easiest route to take. You can then administer emails for the parked domains as well as access their databases by logging in to your primary root’s admin (Cpanel).

Steps to park a domain on top of another

Domain Parking Via Cpanel

To park a domain in Cpanel (Control Panel), simply click on “parked domains,” add your domain, and it will be parked on top of the root domain. To unpark the domain go back to “parked domains,” select which domain you wish to unpark from the drop-down box and select “remove domain.”

Domain Parking Via WHM

To park a domain in Web Host Manager, go to DNS Functions, and click on “park a domain.” From here you will be able to select a) the domain to park on top of, and b) the domain to park. To unpark the domain select “List Parked Domains” from Account Information, and click “UnPark” next to the domain you wish to unpark.

Symlinks point subdirectories at your root installation.

Configuration with shell access

First create a subdomain (ie. newsite.primary.com). This will create a new folder: /root/public_html/newsite. Delete the “newsite” folder, as it will be replaced by your symlink. Inside “public_html,” create the symlink with the following code (shell access):

ln -s . newsite

The symlink “newsite” now points to your document root (public_html) – voila!

Configuration without shell access

It is still possible to execute shell code without shell access. To execute shell code in Drupal, simply create a PHP page with the following and execute it from your root Drupal directory:


In this example the first path is the primary domain, followed by the multisite domain. PHP also has a symlink function you can use:


important: The first example uses backticks (usually to the left of the ‘1’ key on your keyboard), while the second example uses single quotation marks. The backticks tell PHP to execute the code, which we need for the shell script, but in the symlink function we are simply inserting values into an existing function.

Multisite via Virtual Hosts

In order to use this method you or your host will need access to httpd.conf. Since this file controls the entire server this option is normally only available in dedicated hosting environments.

Name VirtualHost
DocumentRoot /absolute/path/to/drupal
ServerName site-root.com

# note that the DocumentRoot is exactly the same for both VirtualHosts
DocumentRoot /absolute/path/to/drupal
ServerName site-one.com

# note that the DocumentRoot is exactly the same for both VirtualHosts
DocumentRoot /absolute/path/to/drupal
ServerName subdomain.site-two.com

How to Update Multisite Installations?

This is a little more tricky, as multisite updating is not quite as smooth (yet) as you might first imagine. First of all, if you are still running 4.6, I recommend NOT deploying multisite environments that you plan on upgrading to 4.7+. The reason? The update process is tedious to the point that you might as well install separate sites. As for those installing 4.7 codebases, as I currently have the majority of my production sites running on, the upgrade process to 5.0 should work as follows, although I have yet to test this.

Upgrading from 4.7.x to 4.7.y in a multisite environment

The process involves replacing all the core files, and the running “update.php” on the primary domain. This will update the primary domain’s database, but if you have your multisites set up with their own databases, you will need to update these independently. Simply run “update.php” from each installation. The problem with 4.6 upgrades is that this simply results in a blank screen (ie. doesn’t work).

Using database prefixes

The alternative to setting up a separate database for each multisite installation is to assign all sites to the same database as the primary domain, but with their own table prefixes. So for example, for the users table you would have:

Multiple Databases

database1.site1.users database2.site2.users database3.site3.users

Single Database

database1.site1_users database1.site2_users database1.site3_users

An advantage prefixing gives you is that you can update all the multisites as once. The obvious disadvantage is that you have all your sites crammed into one database, which can make maintenance (backups) more tedious. Yet another advantage is that you can use this to implement shared functionality, such as allowing login sessions to authenticate across multiple sites.

I hope this helps. Please post any comments or questions below. Also, if you have found a host that is particularly suitable for Drupal multisite installations, please share your recommendations and experiences.

About The Author:

Alex has been involved on the business side of the internet since the early 2000's. He holds both a Management Science degree from the University of California at San Diego as well as a Computer Science degree from NJIT.

We Rock Your Web had its roots back in 2004 as the tech blog for a web design and development company Alex founded that has grown and evolved into the parent company of We Rock Your Web.

While his foundation is rooted in web development, his expertise today lies in content and digital marketing, SEO, organic and paid search, analytics, and publishing. Alex is an avid tennis player, nature enthusiast, and hiker, and enjoys spending time with his wife, friends, and dogs.

Disclaimer: This website contains reviews, opinions and information regarding products and services manufactured or provided by third parties. We are not responsible in any way for such products and services, and nothing contained here should be construed as a guarantee of the functionality, utility, safety or reliability of any product or services reviewed or discussed. Please follow the directions provided by the manufacturer or service provider when using any product or service reviewed or discussed on this website.

Notify of
Oldest Most voted
March 25, 2011 3:09 am

It would be great to see this article updated to be relevant to Drupal 7 as well as the various ‘cloud’ server/space (and VPS) options now available.

July 5, 2011 12:59 pm

I’ve written up a post explaining the background concepts behind Drupal 7 (and 6) multi-site installs at mikehigginbottom.com/content/drupal-multi-site-installations-magic-secret-bits. It has some specifics but focuses on the stuff you need to understand rather than the steps you need to take, so while it’s not exactly a D7 version of this post it might help set you on the right track to adapt it.


Mike Higginbottom

Alex Schenker
March 31, 2011 1:45 pm

We’re working on a D7 update as I write this. Stay tuned!

December 22, 2010 9:46 am

Not sure Drupal multisite setups are really worth it. It seems like they’re more complicated than simply setting up a bunch of individual sites. I would say, as a rule of thumb, if you have less than 5 or so sites, set them up individually. If you have more than a dozen, it’s probably a good idea to bite the bullet and set them up in multi-site format, so updating the core and modules won’t take forever.

October 28, 2010 8:44 am

Hi, I got a Drupal multisite set up quite easily doing the following:

* I got a good hosting provider, then I set my first site up on it
* I got a new domain
* I set a domain addon configuration up on my hosting account (cPanel)
* I set a new DB to host mynewdomain datas
* I set my site to have a new folder in ../sites/ named as my new domain (mynewdomain.com) with setting.php, module folder and template folder
* I set my setting.php to point to mynewdomain DB
* Then I modify NS settings for my new domain to point to my hosting provider
* Finally I got both sites working fine each one with his own template and modules
* Then I added new domains following the same procedure

That’s all.

June 23, 2010 4:49 pm

I have a Drupal based site. The front page is about 200kb and I have 10 trimmed topics in front page. Currently the site is hosted on a shared server. My question is how many hits or page loads per hour/minute should I have before it would be necessary to switch to a dedicated server?

May 24, 2010 10:25 pm

Hi Everyone,

Silicon Valley Drupal User Group is organizing a Drupal Session on MultiSite IN Drupal on 27th May.

Speakers include Karen Stevenson , Fred Davis and Jagdish Harsh.

Some of topics include :

1. Multisite IN Drupal: Challenges and convenience

2. Insights of Non Profit World and their inclination for using Drupal including demo of hivatlas.org

3. Showcase of Drupal IN SaaS Environment

For details please visit http://www.meetup.com/DrupalGroup

on behalf of Silicon Valley Drupal User Group

January 13, 2010 1:38 pm

Here is a good article about Drupal multisite with one database, but specific content types per site.

November 21, 2009 1:08 am

An advantage prefixing gives you is that you can update all the multisites as once.

I would be very happy to learn that the above was true but my research suggest otherwise.

May 9, 2009 12:41 am

Has anyone managed to get a Drupal 6 multisite installation going on the Mosso Cloud?


February 18, 2009 7:23 pm

Is that possible? I wonder if every domain webmaster/superuser could manage their owns Cpanel.

Regards and thanks for this great post

September 20, 2008 11:23 am

You write well, thanks.

I am setting up a multi-site Drupal 6.4 on bluehost.com (which appears to be a good environment). If you are going to set up a customised version of say the Garland theme (which allows users to change colors, etc), I think you should first put a copy of the theme directory under the site’s directory and rename it:

/public_html/sites/example1.com/themes/garland_example1/. . .

then activate and use this. This way updates (which now work pretty smoothly) will not affect existing sites.

September 4, 2008 12:35 pm


I have no idea if you or anyone is still tracking this post, but I’ve stumbled across it, and find it very helpful…although I haven’t attempted the multi-site thing yet.

You keep talking about pointing to the root installation. I installed Drupal in a subdirectory so I could have example.com free to do a front page or whatever, so right now, I have Drupal in example.com/main (and a index.php doc in example.com that automatically fowards you to the subdirectory.

Now, I would like to have example.com/main be my main site, but I have several other sites that i would like to be example.com/site2, example.com/site3, etc. I do not anticipate having all of these other sites as separate domain names, but some will just be subfolders below example.com.

So, my question is can I install Drupal into example.com/main, and have a multisite at example.com/site2? Will the symlink still work? Or, does it need to be example.com/main/site2?


December 13, 2007 11:02 am

I’ve used the to setup a symlink since i do not have shell access. Is there a way i can remove this please?

December 18, 2007 2:45 pm

Try this:

November 5, 2007 9:53 pm

Worked like a charm.


October 18, 2007 3:42 pm

I want to have one old fashion domain that is static HTML and map to DOMAIN1.COM, while I have several other domains that each map to a different DRUPAL website, I am on a shared host and have been able to use a parked domain cPanel settings to get to my sites. But every request to the host seems to want to be a Drupal site. I need a method to set up the static site so it is outside the Drupal site. When I set this up originally I put Drupal at the top of my directory structure.

Thanks for the clear explanations above. David

October 18, 2007 4:30 pm

Hi David,

The easiest implementation would be to have the static domain as a separate domain entirely – separate Cpanel, etc. If your host doesn’t offer multiple hosted domains with your plan they’re almost sure to offer pointers or aliases you can use to setup your different domains.

If you’re putting all sites under one account you’ll probably want to put your static domain in the root, and your primary drupal site in a subdirectory or subdomain with multisites running off the primary installation.

August 30, 2007 7:57 pm

Using Drupal, I am trying to set up multiple sites, on multiple domains, but want one single user interface. Can I do this with Drupal Multisite?

Each domain will have a different theme
Some content will be shared on some or all the sites

August 30, 2007 3:30 pm

Thanks for this page, it makes things clearer.

Because of a bunch of problems, I want to move my sites. I created them originally as separate sites with 5.1, but as I move them, I want to turn them into a multisite with 5.2. Additionally, with D6 imminent, I want to set it up so that I can migrate sites one at a time after I build D6 on the server. I will probably do the actual conversion on my PC, where I sort of have multisite working, and then import the converted database.

This is obviously going to require supporting 2 codebases and 2 sites folders (because of modules). I can’t see why my files folder won’t be okay as it’s mostly images.

Are there any other gotchas I have to watch out for? Tips, tricks, magic?

Nancy W.

May 4, 2007 4:46 pm

So I found your page and a lot of others. Great article by the way, the most helpful and clearly written I have found. Covered what I saw in at least 50 places on Drupal.org…. Anyway, I wrote a symlink() that finely worked, or at least I thought it did. There was no permission denied (Must set the publichtml directory to 755 or 777 before you execute the symlink command) and I got “file doesn’t exist…..”

I thought: “okay, I am running this in the domainroot (publichtml) so the target can be “.”… The source is (Was as it was created by cpanel) one level up, that means, “./subdomain.domainname.tld”‘ I ran the script.

Blank!!!1 No errors, no notices, nothing. How do I know if it worked?

Type in the address of the subdomain…. Nothing but a nice and wonderful 404 NOT FOUND

my drupal: version 5.1

site folder


sites/all ..settings.php



sites/default ..settings.php





sites/test.2wdirect.com ..settings.php






My host gives me cpanel access no ssh. My tld (2wdirect.com) and my subdomain.2wdirect.com are created in the user root. I deleted (as per lots of instructions) the sub.d.tld directory that was created by cpanel. I made the permissions on the symlink.php file 777 and the publichtml 777 while trying to run the script. ———————————————

Question #1: Why do you think I got a 404 error?

Question #2: Is there a way to check in the php code to see if symlink() return TRUE or FALSE?

Question #3: Can you make any suggestions as to what to try next?

March 27, 2007 9:03 pm

Thanks for this great tutorial. I run a dedicated server with WHM/Cpanel on it. I figured out how to do this myself by creating a virtual host and then modifying the httpd.conf section for that virtual host and pointing it to the original install. It would be great to be able to clone a site install to another one. Is this possible?

Alex Schenker
March 27, 2007 9:17 pm

Yes, it’s possible to clone installations. You should be able to use WHM to WHM or Cpanel to Cpanel transfer (quickest way). Alternatively, you can backup the database and files and add them back to the new site installation, making the appropriate adjustments in that site’s settings file (for the new hosting account username).

March 9, 2007 1:06 pm

I have a different .htaccess files confiured for each of my sites. Is it possible to use each one for each site? Where should each of them be placed? What happens to the general .htaccess in the root dir (i.e. absolute/path/to/drupal) ?

Alex Schenker
March 9, 2007 7:33 pm

You should be able to maintain a separate .htaccess file for each site, as well as control all your multisites via the primary .htaccess file. As far as gallery2 is concerned, you may use any .htaccess file. However, I recommend maintaining a separate .htaccess file for each gallery2 installation.


January 27, 2007 10:15 pm

Great article,

I’m just having one problem. My 404s are all going back to the ‘root’ installation. Any way to set it up so that each 404 will go the right 404 page?

Alex Schenker
January 29, 2007 1:20 pm

Are you using the custom error module? If so, make sure you have copies of it in each multisite (primary.com/sites/multisite.com/modules/customerror). You can use this approach to modify and customize modules for each multisite.

January 27, 2007 7:29 pm

Just wanted to say “hi”. Nice website.


January 10, 2007 11:16 pm

How do write the php-script if it isn’t a subdomain? If they are on the same level so to speak. Or if I want three subdomaines to be a multisite but want the main site to be a site on its own?

Alex Schenker
January 18, 2007 2:03 pm

The php script functions for multisites regardless of the level they are set up on. It’s also possible to have a primary drupal site that is the codebase for three subdomain-based multisites. Simply park the subdomains on top of the primary site.

December 30, 2006 9:23 pm

Note that you did not close up sites from running PHP on eachother.

Anyone who follows this howto will end up with a server where every admin of foo.com can run any code (and therefore takeover) on all the other sites on this multisite setup.

Alex Schenker
January 2, 2007 5:44 pm

Thanks for pointing this out! Multisite setups are recommended to be set up in contained environments – in other words, related sites, and site creators should not be granting PHP access to roles they don’t trust. But this raises an important issue, so I’ve added a corresponding Security section at top that all should read.

December 30, 2006 1:28 am

Thanks for this great article. It is great to see the details for multisite all in one place. I am leaning towards using the virtual host method as I can edit httpd.conf. I guess all three methods work the same in the end.


December 18, 2006 6:47 pm

And what about the /files and /Userfiles directories?

My problem is that I wish to create a space for each site keeping separate uploaded files.

Using the following VirtualHost directive (IP are hide) image gallery doesn’t work for subsite http://www.example.com while in the default site it works regurarly.

#Basic setup
ServerAdmin webmaster@aaa.bbb.ccc.ddd
ServerName http://www.example.com
#Include conf.d/drupal.conf
DocumentRoot /usr/share/drupal-4.7.2
Alias /UserFiles /usr/share/drupal-4.7.2/sites/www.example.com/UserFiles
Alias /files /usr/share/drupal-4.7.2/sites/www.example.com/files

RewriteEngine on
#RewriteBase /usr/share/drupal-4.7.2
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all

Alex Schenker
December 22, 2006 4:57 pm

Aliases – have you tried referencing your /files directory with the absolute path – ie. /sites/www(dot)example(dot)com/files? If that works I don’t see why the aliases should not.

As far as the image gallery is concerned – are you referring to gallery2 (menalto)? If so, you need to specify multisite install within the gallery2 installation. It will install a multisite gallery codebase on your primary domain. Your Drupal multisites should then be able to access the primary gallery2 installation. I have yet to actually set this up myself so I can’t yet comment on details.