I host a number of websites for different clients. At the moment I create a new drupal install for domain access sites. Is it possible to create a domain access site with multiple domains inside a multisite setup? eg
sites/domain.com.au/ is a regular basic site not using domain access
sites/multidomain.com.au/ is a site with multiple sub domains using domain access.
sites/domain2.com.au/ is a regular basic site not using domain access

Comments

agentrickard’s picture

Category: feature » support

Yes. But you need to configure sites.php in order to direct the Domain Access-controlled sites to the proper configuration file.

For example, let's say you have the following structure:

  • example.com -- Domain Access under multisite -- config directory example
  • - one.example.com
  • - two.example.com
  • otherexample.com -- Multisite -- config directory otherexample
  • anotherexample.com -- Multisite -- config directory anotherexample

In sites.php, you need the following:

$sites = array(
  'example.com' => 'example',
  'one.example.com' => 'example',
  'two.example.com' => 'example',
);

Only Domain Access sites need to be listed in sites.php -- along with any aliases for those domains.

If you only run one site under DA, that can be the "default" configuration folder, and you would not need sites.php.

When you get this running, please consider adding a handbook page.

adamf321’s picture

Hi,
I have some more questions on Drupal set-up for DA:

I'm working on a suite of 4 travel sites that will share a single Drupal instance using multisite. The sites will share some data (package holidays) as follows: site1 and site2 will share packages, site3 and site4 will share packages. I have some questions on how to set-up Drupal for multisite so that I can use DA to share data:

Do all 4 sites need to share the same database or can I use 4 separate database? Page 1 of the documentation for DA says clearly that they need to share databases, however I've read a couple of other articles which imply otherwise.
If sharing a single database, do they need to share tables (i.e. one table called "node" shared across all 4 sites) or can they use separate prefixes (e.g "site1_node", "site2_node", et al)?
If either configuration is possible, what are the pro's and con's of each?
Thanks for your help

agentrickard’s picture

You are mixing two concepts here. DA uses one set of tables for all sites; it uses Node Acccess to partition data. If you want to share content among all 4 sites, don't use multisite at all.

If you want to have _some_ sites in a DA cluster and others independent or, as it seems, you want to have two separate DA clusters, then you want to use the sites.php trick mentioned in comment #1.

If you do that, I don't advise sharing any tables between the two. You could share users and roles via table prefixing. In that case, normal multisite rules apply. Never, in any event, should you prefix and share node tables.

adamf321’s picture

Ok, I get what you mean about multisite and DA/data sharing being different concepts. The reason I was planning to use multisite is that I will have a lot of shared functionality between the sites.

But are you saying that with DA I have one instance of Drupal, one set of tables, and DA makes it look like multiple sites by controlling which theme and data to display based on the url visited?

agentrickard’s picture

Yes.

And you can run a DA cluster within a traditional multisite as well, as described in comment #1. Certainly it vcan make sense to have the shared modules and features offered by multisite. I just would not mix the table-sharing feature of mutisite with DA.