Hi, I'm Tim Millwood. I am a Web Developer from Abergavenny, UK, and work for Mark Boulton Design, specializing in Drupal. This is my blog!
Multi-site Drupal installations
One of the great things about Drupal is that you can run more that one site off one installation. This saves disk space and load on your server, it also saves maintenance time. With only one installation to manage and update the time spent administering your site drops greatly.
So, how do you setup a multi-site? well, it’s very easy.
- Firstly install Drupal as you would normally. Download it into your web root, copy the settings.php file, add a files directory, setup a database. etc. The domain name for this site for example would be http://www.example.com.
- To add another site, setup another Virtual Host in your apache (or other good web server) settings. This needs to point to the same directory as your first site. The domain name for the second site for example would be http://www.example2.com. Both of these domains will now show the same site.
- In your Drupal sites directory you now need to differentiate between the two sites. Currently you will see a default and all directories. The default directory holds the settings.php which will be used if a site is not defined. The all directory holds the modules and themes used by all sites. By renaming the default directory to example.com you will now only be able to access the site from http://www.example.com, and http://www.example2.com will return an error. If you create a new directory called example2.com, and copy default.settings.php from example.com to example2.com when you navigate to http://www.example2.com you will now see the installation screen.
- The last step is to create a database for example2.com, and enter all the details on the installation screen.
See not that hard really.
The two sites setup in this example use different databases. It is possible to allow two Drupal sites to share the same database. You can even share tables within the database for a sort of single sign on solution. I will try to cover this in another blog post.











