Easy Multi-Site install for Drupal
This post may be a little bit premature - there may be more multisite issues lurking - but given that the Drupal documentation seems to go out of its way NOT to be helpful, here's a quick tip for installing multiple Drupal-powered domains:
- don't use the 'default' site - it'll just confuse you. leave sites/default empty so that if a site falls through, it gives an error
- keep a copy of the original settings.php from your Drupal install lying around
- when you want to create a new site, put a fresh copy of the original settings.php into sites/default
- next, go to the home page for your site (www.example.com) and run the Drupal installer normally
- when you're finished, in addition to write-protecting settings.php, also create sites/example.com and move settings.php there
- voila, you now have a basic multisite ("shared code") install. note the sites are _mostly_ independent at this point (the "files" directory is shared, and possibly some other 'bugs'), there's no single sign-on, etc. If you want that, you'll have more tweaks to do.
This tip differs from the official docs, which tell you that "The easiest way to create additional sites is to copy
the 'default' directory and modify the 'settings.php' file as appropriate." Manual configuration of each site. Ick. And, btw, we hope you know how to create the db tables yourself, we're not going to tell you. After reading through the lengthy explanation of how to set up multiple settings.php files and the search path, I took a leap of faith and moved my #1 site out of default and into its own domain-based site, then went back to try to access site #2. Sure enough, it went through the install procedure again, as I'd hoped.