Multi-Sites Using XAMPP on Windows XP

Last modified: July 11, 2009 - 01:30

This procedure allows you to create multiple sites sharing one common set of Drupal core modules, and has been tested on Windows XP (SP2), Apache 2.2.3, MySQL 5.0.24a, PHP 5.1.6, Drupal 5.2..... I'm assuming that you have a working Drupal installation already. Please note that this hasn't been tested with XAMPP 1.7.1 (MySQL 5.0.51a, PHP 5.2.9 Apache 2.2.11) and Drupal 6.x!

1. Create a new MySQL database with appropriate rights.

  • eg. mydb

2. Create a new folder in your sites folder by copying the default folder and then renaming it with the name of your new site.

  • eg. mysite

3. Create the following sub-folders in the above folder for stuff unique to your new site.

  • mysite\files
  • mysite\modules
  • mysite\themes
  • mysite\tmp

4. Edit the database and base URL in the settings.php file in the folder you have just renamed.

  • $db_url = 'mysql://username:password@localhost/mydb';
  • $base_url = 'http://mysite'; // NO trailing slash!

5. Create a new host in the Windows XP hosts file with same name as new folder.

  • 127.0.0.1 mysite

6. Create a new Virtual Host in the Apache httpd-vhost.conf file with forward slashes in the full pathname (include <> tags as per the examples in the file).

  • VirtualHost *:80
  • DocumentRoot "C:/Program Files/xampp/htdocs/drupal"
  • ServerName mysite
  • VirtualHost

7. Restart the Apache server to load the virtual hosts.

8. Point your web browser at new folder and install Drupal.

9. Create your first user and Administer the File System paths to match step three above.

  • sites/mysite/files
  • sites/mysite/tmp

You can use the Windows Search to find the above files if your not familiar with their locations.

Good luck!

NameVirtualHost

Jerimee - May 5, 2008 - 21:38

Note: the line NameVirtualHost *:80 in httpd-vhost.conf needs to be uncommented.

where is the file

sisyphus - October 17, 2008 - 04:22

where is the file httpd-vhost.conf please?

The file is located in

mukhsim - October 28, 2008 - 18:57

The file is located in "[path_to_xampp]\xampp\apache\conf\extra" folder.

I didn't need to do virtual hosts (Step 6)

ghankstef - February 23, 2009 - 17:02

Worked with just editing the hosts file and adding folders for each faked domain under sites/

install.php

qasimzee - October 26, 2009 - 06:00

I used http://mysite/drupal5/install.php instead of http://mysite/install.php and it worked where "drupal5" is the name of the directory where drupal resides

 
 

Drupal is a registered trademark of Dries Buytaert.