Working with Drupal: Multisites
Multisite installations in Drupal 5 were either simple or dangerously complicated. With Drupal 6, however, its much easier to create simple, inheritance-based multisite setups, using only a couple of modules and some theming know-how.
Domain Access and Virtual Sites
The two modules that make all this much simpler are Domain Access and Virtual Sites. Only one is required and they both have a different set of features, but each allows you to configure websites on different domains which share Users, Content and other basic features, without table prefixing or other nasties.
Domain Access
Domain Access is designed to manage “affiliate sites”, which may or may not need to share content and users. It’s very powerful and flexible, but add’s a requirement that all content is associated with at least one site. This can be set by default, but if you have a large backlog of content and its not all on the one site you have to configure this manually. Depending on how many nodes you have this may be a big job.
Otherwise, Domain Access has a strong feature set:
- Multiple hostnames per domain
- Configure offline & footer messages, as well as default homepage
- Provides menu blocks for each domain
- Optional table prefixing functions
- Set a default domain for site links
- Optionally require users to belong to a domain to see content for it
- Set the domain theme
- Automatically creates subdomains for each user
- Integration with Views, Organic Groups and Taxonomy Access Control
To get Domain Access to work does require adding a few lines of code to your site settings file, and it will require a rebuild of your node access permission on install.
Virtual Sites
On the other hand, if you want a simpler solution, Virtual Sites is a good option. This module leverages the Condition module to check for various conditions and returns a Site configuration as a result.
While Virtual Sites doesn’t limit content or users the way Domain Access does, it gives you more configuration options and allows you to switch “site” based on any rule (or combination of rules) set in Condition (currently Hostname, Path, Site Folder or Custom PHP, which could be used to set on Taxonomy options as well)…
- Set different themes and theme settings
- Set different site information
- Add custom CSS or JS
- Set custom drupal variables
- Force a base url
- Set the site language
Conclusions
Both Virtual Sites and Domain Access offer a powerful set of features that allow the user to easily create new sites from their drupal installation. Domain Access is more suited to affiliated sites which want to control access and posting across domains, while Virtual Sites is suited to control and display of content at the theme level.
Thanks for this information. I’m in the process of finding out how to deal with configurations like the ones you mentioned above, sharing settings and not sharing settings between sites. What I found hard to find is information on how to use the many different settings in the Domain Access module, so if you have some of that information to share, I would really appreciate it.
Thanks!
//Patrik
I haven’t had much production use with Domain Access, Virtual Sites has been more appropriate for projects I’ve been involved with, so I’m not familiar with the nuances of its configuration. It does have some fairly extensive documentation though (for a Drupal module) at http://drupal.org/project/domain.