Multi-site installation tips

In most cases, installing the categoryi module in a multi-site Drupal environment is a no-brainer. Usually, you just install it in the modules/ directory of your shared code base, you enable it for the sites on which you need it, and you're set to go. Even if you're using the wrapperi modules, you shouldn't really need to do anything special: just install the wrapper modules, and enable them on each site that you're also using category on.

But what happens when you want some of your sites to use category, and others to use taxonomy and book? And when, for the sites on which you're using category, you need to install the wrappers? You can't install the wrapper modules, and the original taxonomy and book modules, all in the one code base! One Drupal site cannot have two modules available to it with the same name.

Here's how you can get around this little problem, and have both the wrapper modules and the original taxonomy / book modules installed within your single-code-base multi-site setup. You do it by making use of Drupal's "site specific modules and themes within a shared codebase" feature.

Instead of installing the wrapper modules in the usual modules/ directory, you install them in a number of directories in the form sites/sitex/modules/. So if, for example, you want sitex to use category (and the wrapper modules), and you want sitey and sitez to use the original taxonomy and book modules, you would set up your files as follows:

  • sites/sitex/modules/taxonomy.module, sites/sitex/modules/book.module (where these are the wrapper modules)
  • sites/sitey/modules/taxonomy.module, sites/sitey/modules/book.module (where these are the original modules)
  • sites/sitez/modules/taxonomy.module, sites/sitez/modules/book.module (where these are the original modules)

Make sure that if you do this, you do NOT install the original or the wrapper versions of taxonomy or book in your regular modules/ directory, or in your sites/default/modules/ directory, as this will cause a conflict in that two modules with the same name will be available to one site. Each site must have access to only one file called taxonomy.module or book.module.

You can leave the category module (and co.) installed in your modules/ directory (or your sites/default/modules/ directory) - it will be available to all sites, but only enabled on some. This is better, as there will only be one copy of the category module in your code base. Unfortunately, you will have to maintain multiple copies of the wrapper modules, and the original taxonomy and book modules, because of the need to install a separate copy of these modules for each site.

Note: this document is based on a multi-site support question that was submitted to the category module's issue tracker.