0

I am working with several Drupal 8 installs On a shared hosting environment.
I've got them up and running and they are looking great thanks to the MoreThanThemes themes I'm using. I'm at the stage of adding modules that require libraries.

It would be great if I could simply maintain libraries in a folder like /Home/[accountname]/Libraries outside of the Drupal root folder. In this way several installs could rely on a common set of libraries, and these wouldn't have to be maintained per site (as would be the case if they were stored in /Home/[accountname]/[sitefolder]/Libraries for example).

An equivalent would be storing private files in a folder like /Home/[accountname]/Files.

Would this be possible?

I know that many are very strong advocates for using Composer, but I am interested in answers that do not require using that tool.

2
  • Including a link to this conversation which seems relevant, but inconclusive: drupal.org/project/documentation/issues/…
    – Collega
    Commented Jun 5, 2020 at 11:10
  • 1
    If you're looking for simplicity, symlinks would probably be the easiest method
    – Clive
    Commented Jun 5, 2020 at 12:37

1 Answer 1

2

Sometimes different module versions use different library versions. For example an upgrade for a module comes with supporting the next library version.

AFAICT if you're after simplifying your maintenance, and the sites you're hosting are similar in their features, it makes sense to also set the modules to also be shared.

That is, the entire Drupal installation. This is called a multisite installation and I've been satisfied with that type of a solution when having a cluster of smallish Drupal sites that use the same modules (and libraries) but different themes.

Multisite Drupal

This way you only maintain one Drupal folder on your host (or at least one Drupal for more than one site, you can still have more Drupal folders for more sites if you like, independent of the multisite one).

Each site has its own database.

Advantages are that when you need to update the modules or core you do it only once on that folder, but don't forget to perfom database updates on all the sites that use that Drupal folder, so they will all have to be in Maintenance mode at the same time.

The downside is that when you need to update, you have to do them all.

Each site usually has a special theme, so themes are placed under the specific sites' folder, not under themes/ where the shared themes are.

You can still have individual sites use a special module that you don't want on other sites in the "cluster", just put it under the site's folder and not in the general one.

Libraries will be shared across all sites, but if the modules used across the sites are also of the same version, you win because you've simplified your maintenance.

To clarify, you don't need to enable all the same modules for all sites within a multisite "cluster". The enabled modules don't even need to overlap! One site can use modules a, b, and c, and the other site can use modules d, e, and f. It's only about keeping the versions the same across the sites to simplify the maintenance.

1
  • Thanks prkos - that's probably the clearest explanation of the practical aspects to working with a multisite installation. I've seen some commentary on these and they seem to come with plenty of warnings. But in some cases this can be a very economical feature so I think I might to a couple of testers and see. Cheers and thanks
    – Collega
    Commented Jun 6, 2020 at 3:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.