Community Documentation

Multiple Drupal Sites under Windows

Last updated July 1, 2008. Created by nikmartin on September 17, 2005.
Edited by add1sun, cel4145. Log in to edit this page.

One troublesome area in Drupal-on-Apache/Windows is multiple Drupal sites. Nowhere is this documented as being possible to do using a single code base. The weakness is in the fact Drupal uses symbolic links to point to the directory where Drupal's code resides. In Linux, this is easy by creating a symbolic link to Drupal's root directory:

\Drupal\Site1 -> \Drupal
\Drupal\Site2 -> \Drupal

In Windows, this isn't that easy. Shortcuts in Windows are not usable except when browsing the file system. What not many people know, is that Windows DOES support symbolic links. What Windows doesn't have is a built in capability to build symbolic links. That's where a 3rd party utility is required. I use Junction by Sysinternals. Using the tool is similar to the ln command in Linux.
c:\> junction.exe c:\drupal\Site c:\drupal

Will make a link to c:\drupal from c:\drupal\site

Using this, AND the directions located elsewhere on this site regarding the strutcure of the drupal\sites directories, you can make an attempt at getting multiple drupal sites running under Windows.

Comments

Junction works only on NTFS!...

Unfortunately I installed XAMPP and my Drupal test site on a FAT32 partition and junction does not work on that because only the NTFS filesystem support symbolic links feature.
Have known before...

~ Cristian Palmas ~

~ Cristian Palmas ~

Symbolic Link tool in Windows Vista

There is a tool included in Windows Vista that will allow you to create a symbolic link, MKLINK.
It works in a similar fashion to junction, except the syntax is a little different.

C:\> mklink /J C:\drupal\Site C:drupal

For more information, use:

>mklink /?

or

http://technet.microsoft.com/en-us/library/cc753194.aspx

CygWin - bash shell for Windows

If you're a UNIX/Linux user, you may already know about CygWin (http://cygwin.com/), a bash shell along with many Unix utilities for Windows.

The standard 'ln' command does what is required.

About this page

Drupal version
Drupal 4.6.x

Develop for Drupal

Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.