Multiple Drupal Sites under Windows

Last modified: July 1, 2008 - 21:45

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.

Junction works only on NTFS!...

Cristian.Palmas - May 2, 2008 - 17:12

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 ~

Symbolic Link tool in Windows Vista

swashuta - October 6, 2008 - 16:12

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

 
 

Drupal is a registered trademark of Dries Buytaert.