In #2306013: Multisite is a valued feature that will not be deprecated. is was suggested that Drupal's multisite functionality be scrapped. A key rationale was because a) the documentation was alleged to be not very good, b) it could be tricky to set up. Rather than scrapping the functionality, lets improve the documentation with concrete examples on how it works and how to use it.

Comments

DamienMcKenna created an issue. See original summary.

shrop’s picture

We need to know where all the docs and mentions are for multisite. Thought I would list a few spots that I have found:

Multisite Drupal documentation

Drupal 7.x

includes/bootstrap.inc
[1] 593: * any input. However, command line scripts running on a multisite installation

INSTALL.txt
[2] 9: * Multisite configuration
[3] 139:      directory within it for you. (If you are creating a multisite
[4] 141:      see the Multisite Configuration section of this file, below.)
[5] 315:multisite installation, you can also place modules and themes in the
[6] 316:site-specific directories -- see the Multisite Configuration section, below.
[7] 324:MULTISITE CONFIGURATION
[8] 381:For more information on configuring Drupal's file system path in a multisite

modules/forum/forum.module
[9] 20:      $output .= '<ul><li>' . t('Forum topics submitted by users (for example, <em>How to start a Drupal 6 Multisite</em>), which start discussions and are starting points for:') . '</li>';

modules/README.txt
[10] 4:For multisite installations, they can also be placed in a subdirectory under

profiles/README.txt
[11] 18:MULTISITE CONFIGURATION
[12] 21:In multisite configurations, installation profiles found in this directory are

sites/all/modules/README.txt
[13] 26:MULTISITE CONFIGURATION
[14] 29:In multisite configurations, modules found in this directory are available to

sites/all/themes/README.txt
[15] 17:MULTISITE CONFIGURATION
[16] 20:In multisite configurations, themes found in this directory are available to

sites/default/default.settings.php
[17] 14: * if the multisite aliasing file named sites/sites.php is present, it will be

sites/default/settings.php
[18] 14: * if the multisite aliasing file named sites/sites.php is present, it will be

sites/README.txt
[19] 2:to your site or sites and is an integral part of multisite configuration.
[20] 10:In multisite configuration, extensions found in the sites/all directory
[21] 19:installation or multisite configuration.

themes/README.txt
[22] 4:For multisite installations, they can also be placed in a subdirectory under

Drupal 8.3.x

core/includes/file.inc
[1] 237: * May be useful to prevent problems on multisite set-ups and prevent mixed

core/INSTALL.txt
[2] 10: * Multisite configuration
[3] 142:      creating a multisite installation, substitute the correct sites directory
[4] 143:      for sites/default; see the Multisite Configuration section of this file,
[5] 348:normally placed in the /modules and /themes directories. If you run a multisite
[6] 350:directories -- see the Multisite Configuration section, below.
[7] 358:MULTISITE CONFIGURATION
[8] 423:For more information on configuring Drupal's file system path in a multisite

core/lib/Drupal/Core/Cache/Context/SiteCacheContext.php
[9] 14: * different entry points. (Different sites in a multisite setup have separate

core/lib/Drupal/Core/DrupalKernel.php
[10] 1508:   * settings.php for multisite installations, sites using ServerAlias without

profiles/README.txt
[11] 18:MULTISITE CONFIGURATION
[12] 21:In multisite configurations, installation profiles found in this directory are

sites/default/default.settings.php
[13] 13: * In order to use the selection rules below the multisite aliasing file named
[14] 714: * If you are running multisite, or if you are running your site from

sites/README.txt
[15] 2:to your site or sites and is an integral part of multisite configurations.
[16] 10:multisite configuration.

sites/default/settings.php
[17] 13: * In order to use the selection rules below the multisite aliasing file named
[18] 689: * If you are running multisite, or if you are running your site from
btopro’s picture

INSTALL.txt in D7
core/INSTALL.txt in D8.3.x
and settings.php files in each would be the most critical as far as improving documentation in the code that goes out the door.

In looking at the documentation on d.o. I think it's pretty good, though it might want to include more cautions / use cases instead of just pointing to The Great Multisite Debate (which is also very useful to point to). The D7 INSTALL file technically points to the wrong location (D6 docs) but then gets redirected over to - https://www.drupal.org/docs/7/multisite-drupal/multi-site-sharing-the-sa... which is a very good starting point.

btopro’s picture

Cleaned up some of the documentation associated with when to multisite as well as started a recommended multisite configuration settings -- https://www.drupal.org/docs/7/multisite-drupal/multi-site-sharing-the-sa...

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

kienan’s picture

Has anyone found or made documentation that details how to use composer in a multi-site? All the documentation I've found so far deals with using composer at the drupal-wide level (the root composer.json).

As modules start to require composer to resolve their dependencies, it isn't obvious (at least to me) how to properly handle that in a multi-site installation. Running composer init and setting dependencies in the site directory doesn't work since anything like "composer require drupal/module_name" will depend on drupal itself and install drupal/symfony/etc. in the vendor/ directory of the site.

clemens.tolboom’s picture

@kienan for D7 use https://www.drupal.org/project/composer_manager and read their D8 section too.

kienan’s picture

@clemens.tolboom, thanks but those pages don't seem to address the situation I'm looking at.

I'm working principally with Aegir for hosting sites in common platforms (drupal core installations). A certain number of dependencies are managed at the platform level, through either composer or drush make. The workflow with composer at this level is clear and detailed in the current documentation.

Everything in the site can be treated as a separate project which depends on the platform - not too dissimilar to the drupal-composer/drupal-project template; however, the site isn't placed in sites/default.

As a developer of a site hosted in a multi-site environment I want to be able to:

  • Use composer to manage the dependencies of the site without making changes to the platform it depends on (runs in)
  • Deploy the site in a multi-site environment without requiring that code be deployed at the platform-level as well

Consider a drupal-site project organized thusly:
projectdir
-- composer.json
-- tests
-- ....

which will eventually live in a deployed environment like drupal-8.3.2/sites/projectdir

If I require drupal/search_api and drupal/search_api_solr (search_api_solr, must be installed with composer), the entire drupal stack is pulled in - which is fine. As far as I have seen (and I could easily have missed it), the sites/X/vendor directories aren't autoloaded. There's of course an issue trying to figure out the minimum dependencies to keep in the sites/X/vendor. In short, I can't reasonably install a contrib module which requires composer in a site directory.

There might be some possible some solution in the vein of the composer-merge-plugin or drupal-merge-plugin that I haven't fully explored.

At any rate, if someone comes up with a good way to manage this I'd love to hear about it.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

colan’s picture

@kienan: See #3004496: Improve multisite compatibility with composer for some discussion on multisite + Composer.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.