Drupal 8 Multi-site | Platform.sh demo

Опубликовано: 19 Февраль 2020
на канале: Platform.sh
1,632
10

Drupal can be configured to allow multiple sites to be served from a single codebase. This demo shows how to implement a Drupal multi-site project on Platform.sh.

You can set up each site with a separate subdomain on Platform.sh quickly with only a few modifications to our Drupal 8 template.

First, you can modify your routes.yaml file to assign a unique subdomain for each site. We're going to use the subdomains first and second for the two sites, and reuse those names throughout all of the following configuration steps. Notice how each subdomain is pointing at the same application, called app, as its upstream route.

Next, you can give each site its own config/sync subdirectory, as well as settings in the site's subdirectory. To start off, each site's settings can be identical to those in default, but you can always customize them when you need to.

Each subsite first and second has its own database and endpoint, so we will give each of them a corresponding relationship in our .platform.app.yaml file.

Each of those databases is defined for the same MariaDB instance in the project's services.yaml file. Notice that each database's relationship uses the service name db but then includes the unique endpoint defined for each of the two sites.

Once we deploy the application, we can see that each subdomain contains its own separate Drupal 8 installation.

We kept the subsite and endpoint names identical so that we could include some glue code that gets each installation to talk to the right database. While we did not cover that code in this demo, it's relatively simple, so be sure to check out our Drupal 8 Multisite template on GitHub for all of the details.
____
Learn more: https://platform.sh/blog/one-codebase...
Get started with a free trial: https://auth.api.platform.sh/
Have a question? Contact us: https://platform.sh/contact/

Key moments:
00:00 - Intro
• Introduction to setting up a Drupal 8 multi-site on Platform.sh, using a single codebase to serve multiple sites.

00:36 - Configuring Subdomains
• Demonstrates how to assign unique subdomains for each site within the Drupal 8 setup, using the routes.yaml file.

01:02 - Site Configuration and Database Setup
• Overview of setting up individual configurations and databases for each site, detailing modifications in the platform.app.yaml and services.yaml files.

01:34 - Deployment and Database Integration
• Shows the deployment results on Platform.sh, with each subdomain hosting a separate Drupal 8 installation and database connections.


Смотрите видео Drupal 8 Multi-site | Platform.sh demo онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Platform.sh 19 Февраль 2020, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 1,632 раз и оно понравилось 10 людям.