ants01’s picture


1. Create dns entries for the sites ( or use hosts file for testing)
2. Create vhosts in Apache configuration file and restart Apache:

Listen 80
<VirtualHost *:80>
    DocumentRoot "C:/Program Files/xampp/htdocs"
    ServerName localhost:80

<VirtualHost www.site1.local:80>
    DocumentRoot "C:/Program Files/xampp/htdocs"
    ServerName www.site1.local:80

<VirtualHost www.site2.local:80>
    DocumentRoot "C:/Program Files/xampp/htdocs"
    ServerName www.site2.local:80

3. Create folder sites under drupal/sites


Note: Each site folder can have a file, tmp, modules and themes subfolders.

4. Copy settings.php from drupal/sites/default to each site folder.
5. Modify $db_url and $db_prefix in settings.php in each site folder.

For www.site1.local: Single database and db user.

$db_url = 'mysql://drupal:drupal@localhost/drupal';
$db_prefix = 'site1_';

For www.site2.local: Single database and single db user.

$db_url = 'mysql://drupal:drupal@localhost/drupal';
$db_prefix = 'site2_';

For www.site1.local: Multiple databases and single db user.

$db_url = 'mysql://drupal:drupal@localhost/site1';
$db_prefix = '';

For www.site2.local: Multiple databases and single db user.

$db_url = 'mysql://drupal:drupal@localhost/site2';
$db_prefix = '';

Note: Always use the same db user (the one that you used to install drupal for the first time) independently if you want to have a single or multiples db’s.

6. Open your web browser and point to the install.php file for each site


7. Your new sites are ready using a single code base, single db user and single or multiple db’s.


loyeyoung’s picture

ant01's description is extremely helpful and cogent.

It appears that the instructions contemplate that each site has other content not controlled by Drupal. Thus, www.site2.local and www.site2.local/drupal would have different content. Perhaps the site owner has a static page for product information at the root URL, and the Drupal site is for employees, vendors, or customers.

However, for many of us, Drupal serves all content. If one wants the content for ALL traffic for www.site2.local to be served by Drupal, the following changes would be made:

Step 2: Add "/drupal" to the end of the DocumentRoot statement, so that it reads:

    DocumentRoot "C:/Program Files/xampp/htdocs/drupal"

Step 6: Remove "/drupal" from the path to install.php, so that it reads:

Step 7: Remove "/drupal/" from the URL:

Depending on your configuration, you may also need to change the RewriteBase from "/drupal" to "/". RewriteBase might be found in your Apache (or other httpd) configuration files or in htaccess, again depending on your configuration.

If you want to have non-Drupal content, but you want the Drupal content to be the default, use RedirectMatch:

     RedirectMatch ^/$ /drupal

The RedirectMatch alternative would still use "/drupal" in the URL of the Drupal site. The URL of www.site2.local would be redirected to www.site2.local/drupal. If the site had other content, such as www.site2.local/foo, content from "C:/Program Files/xampp/htdocs/foo" would be served.

Loye Young
Laredo, Texas

to-john’s picture

Some minor clarifications for us neophytes

if you get

Warning: Table 'drupalsite1dbnamehere.access' doesn't exist query: SELECT CASE WHEN status=1 THEN 0 ELSE 1 END FROM access WHERE type = 'host' AND LOWER('') LIKE LOWER(mask) ORDER BY status DESC LIMIT 0, 1 in C:\drupal\includes\ on line 172

you went to


instead of


Also, my hosts file got corrupted while messing with this, which may or may not be related to my mucking around with XAMPP and C:\WINDOWS\system32\drivers\etc\hosts, but if you can't seem to figure out why you can't go to http://www.site1.local/drupal, try recreating your C:\WINDOWS\system32\drivers\etc\hosts file. The entries should be localhost [should already be there] www.site1.local www.site2.local

Here's a variation of the httpd.conf file entries that works for me (note the / instead of the \ in the path name)

Listen 80

<VirtualHost *:80>
   DocumentRoot "C:/xampp/htdocs"
   ServerName localhost
   ServerAlias www.site1.local, www.site2.local, www.site3.local
streulma’s picture


here's how to do that with Direct Admin:

- create a subdomain in Direct Admin example:
- you have a subfolder in public_html, delete that folder with the contents
- chmod only the public_html folder to 777 to create the symlink
- create a symlink between public_html and the name of the sub = sub
upload ln.php to the public_html folder and go to
- make a new database in Direct Admin
- copy the /sites/default folder to /sites/
- edit settings.php and correct the database settings
- go to, you get errors with table not found, that's good!
- go to and run the install
- That's it!
- to delete a link upload unlink.php to public_html folder
- chmod only the public_html folder to 777
- run and that's it.

Here's the php code to create the symlink:

$target = '/home/username/domains/';
$link = '/home/username/domains/';
symlink($target, $link);

echo readlink($link);

Here's the code to unlink the symlink:

//set the name of the link 
    $link = "dev";
//remove the symbolic link we created before
kmadel’s picture

Let's say you want to use a single Drupal install to run your company's primary web site and your company's blog site (multisite), but you also have different themes and navigation hierarchies for the two sites. Sure, there are some Drupal modules that may provide most of this functionality. However, you can accomplish exactly the same thing with a plain vanilla Drupal install and the Pathauto module (a module that you should really be using anyways).

Check out the rest in my blog entry at: Drupal Multisite

mennonot’s picture

If you're installing the second site in a sub-directoy, don't forget to change the RewriteBase in .htaccess. Here are the instructions that worked for me from

However, if your sites are in different subdirectories, RewriteBase will not work. You will need to create a special rule for each subdirectory. For example, your Drupal installation may serve the following sites:

In order to enable clean URLs for both sites, you will need to add

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/mysite/(.*)$
RewriteRule ^(.*)$ /mysite/index.php?q=$1 [L,QSA]

before the existing rewrite rules.

alexmoreno’s picture

is it possible to run multisite on cherokee or any other light server? It's is relatively easy to run on a single drupal, but what about running on a multisite configuration?

Thanks in advance

Gaurav.soin’s picture

Silicon Valley user group is organizing a Meet up on "Multisite IN Drupal" and the speakers include Karen Stevenson , Fred Davis and Jagdish Harsh.

RSVP here

for more details please contact me.

sjdavis’s picture

In an effort to host multiple sites using urls like I found I needed to have Alias's and rewrite rules for each sub-site in my vhost file:

Alias /drupal_1 /var/www
Alias /drupal_2 /var/www

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/drupal_1/(.*)$
RewriteRule ^(.*)$ /drupal_1/index.php?q=$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/drupal_2/(.*)$
RewriteRule ^(.*)$ /drupal_2/index.php?q=$1 [L,QSA]

Here's a helpful page explaining Drupal multisite in subfolders.’s picture

In the same line of thought, if you use a subdomain for multisites, remember to 'hash' the following .htaccess option:
# RewriteBase /my_drupal_install_folder

Since my Drupal installation is in a subdirectory, I had activated this part in .htaccess :
RewriteBase /my_drupal_install_folder

My multisite subdomain has as root /my_drupal_install_folder, so it made no sense for the .htaccess to call for /my_drupal_install_folder

Once I added # before RewriteBase, all worked fine.

Nb - Tip : To create my multisite tables, I simply create a new database and use the phpMyAdmin option to copy all tables to another database. By doing this, you suddenly have an exact copy of your production site! But you'll need to flush all caches for your new multisite (ex.: to work.

Michael Lessard
webmaster of Quebec City "democracy in action" media

Tilt_11’s picture

I have a few Drupal sites installed...All of them used to have their own Drupal files.

Today, I decided to regroup two of them in only one Drupal installation (Each one keeps its own database)
The main site is and the one I wanted to use the same files is

I made all the necessary modifications (Create a subdirectory in sites/default, redirect the domain to the main Drupal installation folder, move the custom modules, themes and files folder, etc...) Things worked perfectly as long as I was using Firefox...Then, I tested on IE and Chrome....The home page shows TheBaySoccer on these 2 browsers. If I change the URL to, then I get the right page in any of the 3 browsers.

I think I am missing something. Maybe a reference to the old path in the database?

I contacted my host explaining the problem and asking them if there was a chance it had something to do with the server configuration...Their answer was not very satisfying:

"There are many reasons why a web page may not be visually consistent. If you added any CSS code, Iframes. nested tables, special fonts, widgets / gadgets, formatting characters and user text settings with different browser preferences, all of which can have different effects on different browsers. Sometimes, it gets so bad that the web designer will put a special logo stating that “this site is best viewed by using … browser”"

If anyone knows about this issue, please let me kmow...Thanks for your help!

rj.seward’s picture

Please see my post at for a D7 multisite install.

donSchoe’s picture

drupal 7 multi-site configuration is very simple, all you need is to read and understand the sites.php

kaizerking’s picture

How to install a install profile(Distribution) in multi site environment?
can i i uses same code base to different distributions?
if so how to do that?

mhamed’s picture

I managed to arrive to the initial screen of choosing between the distributions by.
installing the distributions for example:
commerce_kick-start openhotel panopoly
on a drupal.local server
i changed everything for the memory

max_execution_time = 300     ; Maximum execution time of each script, in seconds
max_input_nesting_level = 300
max_input_time = 180	; Maximum amount of time each script may spend parsing request data
memory_limit = 512M      ; Maximum amount of memory a script may consume (8MB)

and permissions
but once starting to install they gave me the error:
An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: http://school.drupal.local/install.php?profile=panopoly&locale=en&id=1&op=do StatusText: OK ResponseText: Home | Drupal @import url("http://school.drupal.local/modules/system/system.messages.css?0"); @import url("http://school.drupal.local/modules/system/system.menus.css?0"); @import url("http://school.drupal.local/modules/system/system.theme.css?0"); @import url("http://school.drupal.local/modules/system/system.base.css?0"); @import url("http://school.drupal.local/sites/all/modules/contrib/date/date_api/date.css?0"); @import url("http://school.drupal.local/sites/all/modules/contrib/date/date_popup/themes/datepicker.1.7.css?0"); @import url("http://school.drupal.local/modules/field/theme/field.css?0"); @import url("http://school.drupal.local/modules/node/node.css?0"); @import url("http://school.drupal.local/modules/search/search.css?0"); @import url("http://school.drupal.local/modules/user/user.css?0"); @import url("http://school.drupal.local/sites/all/modules/contrib/views/css/views.css?0"); @import url("http://school.drupal.local/modules/system/system.admin.css?0"); @import url("http://school.drupal.local/modules/system/system.maintenance.css?0"); @import url("http://school.drupal.local/sites/all/modules/contrib/ctools/css/ctools.css?0"); @import url("http://school.drupal.local/sites/all/modules/contrib/panels/css/panels.css?0"); @import url("http://school.drupal.local/profiles/panopoly/panopoly.css?0"); @import url("http://school.drupal.local/themes/seven/reset.css?0"); @import url("http://school.drupal.local/themes/seven/style.css?0"); Home Installation tasksChoose profile(done)Choose language(done)Verify requirements(done)Set up database(done)Install profile(active)Configure siteVerify Apps supportInstall AppsChoose a themeFinished Warning message The image resize filter has been installed. Before this does anything, the image resize filter needs to be added to one or more text formats. Visit the text format administration to set up this filter. SQLSTATE[42S02]: Base table or view not found: 1146 Table 'school.media_type' doesn't exist
i m tried some tutorials and patches but the same.
to note the installing drupal normalmenty without these contrib dist is so quick

radamiel’s picture

yngens’s picture

There is an alternative Drupal-multisite setup done by Drupion: