![]() ![]() PASTE THIS AT THE END OF /sites/multisite2/settings.php $lando_info = json_decode ( getenv ( 'LANDO_INFO' ), TRUE ) if ( ! empty ( $lando_info ) ) Set up sites.php Specifying ports simplifies using tools like TablePlus to browse your databases, although the more straightforward portforward: true should work as well, and is Lando’s recommended approach. You may notice I’m specifying ports for the portforward values. It’s likely (especially if you’re a Lando aficionado) that your lando file will have some other configurations - but below are the bare necessities for running a multisite. lando.yml configuration for a Drupal 9 multisite setup with two sites which we’ll call multisite1 and multisite2. lando.yml file, your settings.php file(s) and your sites.php file. We’ve got three tiny steps to complete here: modifications to your. Lando drush site :install -db -url =mysql : //drupal9: /drupal9 -y # List information about this appĪnd just like that we’ve got a Drupal 9 site running on Lando. # Initialize a drupal9 recipe using the latest Drupal 9 version The somewhat unwieldy terminal commands look like this (pulled directly from the link above): ![]() I called my app landomultidrupal so change that value as you see fit. You’ll want to start in your projects directory then run the following commands. Initializing a Drupal project on Landoįor this demo I used Lando’s Quick Start for Drupal which just takes a couple of minutes to run. This way Lando will work with the particular 4.6.1 version we already downloaded and installed. The Lando DMG installer is very straightforward, just follow the onscreen instructions but make sure to choose “Custom” installation type, and uncheck Docker from the list of packages to install. If you have a newer Mac with an Apple chip choose the latest lando-arm64-vx.x.x.dmg, for Intel chips choose the lando-圆4-vx.x.x.dmg. When downloading the installer make sure to choose the right file - again, depending on your Mac’s chipset. I used the DMG installer for this walkthrough. Once you have Docker Desktop installed, you can install Lando. You can check your chipset on your Mac by clicking Apple Icon > About this Mac. Follow the link above to install Docker - and make sure you choose the right platform for your chipset, whether that’s Apple or Intel. A lot of us here at Aten have been running Lando with Docker Desktop for Mac 4.6.1 - it’s possible this Drupal multisite setup will work with other versions but I’m sure it works with this one. If you already have Lando installed on your machine you can skip ahead, but just FYI I’m using a particular version of Docker for this build. Installing Lando and Docker Desktopįirst things first: install Docker and Lando. There are a host of uses for multisites, but if you think about different websites for different store branches or maybe a variety of individual blog sites driven from the same or similar setup you’d be on the right track. ![]() If you’re here you probably know what a Drupal multisite is, but just in case: Multiple separate websites, each with its own database and configuration, served from the same code base. It’s well supported, has an active developer community, and can be configured for a variety of tricky use cases like emulating a Pantheon environment (that will have to be a different post) or setting up a Drupal multisite. Recently we’ve been pretty satisfied with Lando for Drupal development. ![]() I’ve centralized them here for posterity.īuilding and operating local development environments that reflect your production environments can be tricky - especially as the landscape of tools, libraries, and automations continues to evolve. Setting up a local Drupal multisite with Lando isn’t complex with the right docs, but it took me a little while to find all the right bits of configuration. ![]()
0 Comments
Leave a Reply. |