Project

General

Profile

Actions

CiviCRM multi-site checklist » History » Revision 1

Revision 1/5 | Next »
Jon Goldberg, 03/06/2015 02:31 PM


Updated about 9 years ago by Jon Goldberg

CiviCRM multi-site checklist

The first two steps have more detailed docs below.
  • Follow the multi-site docs here
  • Set up cron jobs per site for sending mail and incoming activity handling (see here).
  • Install the "multisite" extension. There's an install bug on the one on the directory, use github
  • Multisite extension adds new permissions which need setting. If using Domain Access, you can set the permissions once. If using Wordpress or Drupal "true" multi-site, user permissions are per-site!
    • CiviCRM Multisite: view all contacts in domain
    • CiviCRM Multisite: edit all contacts in domain
    • CiviCRM Multisite: list all groups in domain
  • Make sure you set all the settings that are per-site! Especially:
    • Postal/e-mail address for the default organization
    • "From" Addresses
    • CiviMail > Mail Accounts > Bounce Account (should match main site)
    • CiviMail > Mail Accounts > Email-to-Activity account (unique per site)
    • If Wordpress: base page (note that this allows you to set a different theme per site)

Editing civicrm.settings.php

Protip: Did you remember to comment out CIVICRM_DOMAIN_ID and CIVICRM_UF_BASEURL?

If you're using a "true" multi-site, where each site has its own civicrm.settings.php, the documentation on the CiviCRM wiki will suffice. Even if you're using Wordpress or Domain Access, there's good documentation there (I know, I wrote most of it).

The trick is to write code that can determine your domain based on the URL. Here is an example of how to do that using Domain Access or Wordpress with subdomain multi-site:

switch ($_SERVER['SERVER_NAME']) {

case 'www.xxx.org':
case 'xxx.org':
  define( 'CIVICRM_DOMAIN_ID', 1 );
  define( 'CIVICRM_DOMAIN_GROUP_ID', 2);
  define( 'CIVICRM_DOMAIN_ORG_ID', 105383);
  define( 'CIVICRM_UF_BASEURL'      , 'http://www.xxx.org/' );
  $civicrm_setting['URL Preferences']['userFrameworkResourceURL'] = 'http://www.xxx.org/sites/all/modules/civicrm';
  break;

case 'cdp.xxx.org' :
  define( 'CIVICRM_DOMAIN_ID', 2 );
  define( 'CIVICRM_DOMAIN_GROUP_ID', 19);
  define( 'CIVICRM_DOMAIN_ORG_ID', 106726);
  define( 'CIVICRM_UF_BASEURL'      , 'http://cdp.xxx.org/' );
  $civicrm_setting['URL Preferences']['userFrameworkResourceURL'] = 'http://cdp.xxx.org/sites/all/modules/civicrm';
  break;
// etc.
}

Wordpress with subfolder multi-site is a little trickier, here's what I've got:

$multi_site_path = explode("/", $_SERVER[REQUEST_URI]);
if ($multi_site_path[6] == "cron.php") {
    $multi_site_choice = $_POST["site"];
} else {
    $multi_site_choice = $multi_site_path[1];
}

switch ($multi_site_choice) {

case 'wp-admin':
case '':
case false:
  define( 'CIVICRM_DOMAIN_ID', 1 );
  define( 'CIVICRM_DOMAIN_GROUP_ID', 84);
  define( 'CIVICRM_DOMAIN_ORG_ID', 1);
  define( 'CIVICRM_UF_BASEURL'      , 'http://www.yyy.org/' );
  break;

case 'hcnmd':
  define( 'CIVICRM_DOMAIN_ID', 2 );
  define( 'CIVICRM_DOMAIN_GROUP_ID', 74);
  define( 'CIVICRM_DOMAIN_ORG_ID', 67459);
  define( 'CIVICRM_UF_BASEURL'      , 'http://www.yyy.org/hcnmd' );
  break;

Updated by Jon Goldberg about 9 years ago · 1 revisions

Also available in: PDF HTML TXT

Go to top