Apache supports both IP- and name-based virtual hosts (vhosts). While running more than one engine (by using vhosts) can be very useful for development and testing purpose, it is most useful for hosting companies. Therefore, we support vhosts in the best possible way in order to make the life of all administrators easier. We do so by making it possible to run an unlimited number of vhosts on the same physical source tree, through using different configuration files. Moreover, you can setup multiple configuration files in your includes-directory.

$ ls -l sites/*/*.php
-rw-rw-r--    1 drupal   drupal      sites/www.example1.com/settings.php
-rw-rw-r--    1 drupal   drupal      sites/www.example2.com/settings.php

The only thing left to do is to set up the corresponding vhosts in your Apache configuration file. Note that the DocumentRoot points to the same source tree twice:

NameVirtualHost 127.0.0.1

DocumentRoot /home/www/drupal
ServerName www.example1.com

DocumentRoot /home/www/drupal
ServerName www.example2.com

Remember that, as of Drupal 4.6, you can have site specific modules and themes as well. Just create a directory under the sites/www.example1.com called 'modules' and place the site specific modules in it. The same applies to themes as well.

Consult the INSTALL.txt that came with your Drupal installation for more details.

Note that the same effect can be accomplished without further editing httpd.conf if Apache's default virtual server has the Drupal directory as its document root.