Setting up a Drupal multisite environment locally using XAMPP for Windows
I have a tutorial up on setting up Drupal for a multisite configuration on a host server. Here, I will attempt to chronicle my steps for setting up a local multisite configuration using XAMPP on Windows XP Pro. There is a really good tutorial at http://neemtree.com.au/developing-drupal-using-xampp which I recommend, but sometimes I just need to work through the steps myself. If anyone else finds this useful, then that's an added bonus!
Install XAMPP
First, you need to get XAMPP installed and verify that it is working. Download XAMPP from http://www.apachefriends.org/en/xampp.html (note that I go with the full version, but XAMPP Lite should work also.) I'd recommend getting the .exe installer version, unless you are comfortable setting up the files in the .zip (it's really not that bad...) I am going to assume that xampp is located in c:\xampp, but you can put it anywhere, just keep that in mind as you follow the tutorial. Once you have it installed, open the XAMPP control panel and start Apache and MySQL. You can then open a browser and enter http://localhost, which should bring up a page that looks like this:

Create a database for your sites
Navigate to http://localhost/phpmyadmin and create a new database for each of your sites. For this tutorial, we will use the following databases: demo_multisite1, demo_multisite2, demo_multisite3. You should also give each database a username and password, but for the sake of this tutorial, we'll just stick with the default 'root' and 'no password'.
Install Drupal
For the purposes of our tutorial, let's say that the default site is 'multisite1' and then we want to add a couple of other sites, 'multisite2' and 'multisite3'. Create a folder in c:\xampp\htdocs called 'multisite1'. Copy the latest Drupal core files to c:\xampp\htdocs\multisite1. At this point, you can install the default site as per usual (note that the sites/default directory will be used for this site.) Use the database demo_multisite1 for this site.
Tell Windows and Apache about the multiple sites
At this point, you should be able to go to http://localhost/multisite1 and view your new site. Now, we need to make some changes so that you can access the sub-sites (this is needed before you can install them.)
Open your Windows 'hosts' file in a text editor. This is typically in <WINDOWS_FOLDER>/system32/drivers/etc/hosts. By default, this will probably be entirely commented out, but have examples on how to modify it. What you need to do is go to the bottom and add the following lines:
127.0.0.1 multisite1 127.0.0.1 multisite2 127.0.0.1 multisite3
What this does is make Windows realize that these sites exist on the computer, so you will be able to simply browse to http://multisite1, http://multisite2, or http://multisite3.
To tell Apache about the multiple sites, edit httpd-vhosts.conf file, which should be located in c:/xampp/apache/conf/extra. I think most other apache distributions have a similar file structure, but you can always use the Windows file search to find it. Edit this file in any text editor by adding the following at the end of the file:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/multisite1"
ServerName multisite1
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/multisite1"
ServerName multisite2
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/multisite1"
ServerName multisite3
</VirtualHost>
I'll explain a bit about what's going on. The first VirtualHost entry ensures that when we go to http://localhost, we still get the XAMPP front page (if we left that out, we would end up getting our multisite1 page.) The following 3 VirtualHost entries tell apache that the site is located in C:/xampp/htdocs/multisite1 (our default site) and that the server name is multisite1, multisite2, or multisite3. This means, that when we enter http://multisite2, for instance, it will look for the data in C:/xampp/htdocs/multisite1, but Drupal will pull up the appropriate site based on the server name. This will be taken care of soon (right now, it will still bring up multisite1.)
One last modification we may need to make is to insure that Apache is using virtual hosts, and to enable clean urls. To do this, open the Apache httpd.conf file in a text editor. This will be located in c:/xampp/apache/conf. Search for the following line:
LoadModule rewrite_module modules/mod_rewrite.so
If there is a '#' at the beginning of the line, remove it to uncomment the command. Next, find the following:
# Virtual hosts Include conf/extra/httpd-vhosts.conf
and make sure that the include is not commented. If it doesn't exist at all in the file, add it at the end.
Restart Apache to load the new settings.
Create directories for the sub-sites
Navigate to c:/xampp/htdocs/multisite1/sites and create the directories 'multisite2' and 'multisite3'. You could also simply copy the default directory and rename it accordingly. If you choose to create new directories, be sure to copy the default-settings.php file to each directory and rename it to settings.php.
Install the sub-sites
In an open browser, navigate to http://multisite2 (or http://multisite2/install.php) to begin installation of multisite2. The installation procedure will be basically the same as when you installed multisite1. Repeat for any additional sites (e.g. multisite3.)
Enjoy your multisite setup
You can now use your various sites, using a single codebase of Drupal.
