Skip to main content
Key2Goal

Main navigation

  • Home
  • About Us
  • Contact us
  • Glossary
  • Privacy Policy
User account menu
  • Log in

Breadcrumb

  1. Home

How to setup Multisite in drupal 9

Set up a multisite configuration in Drupal 9, you can follow these steps:

  1. Prepare the Environment:

    1. Ensure that you have a working Drupal 9 installation.
    2. Set up separate directories for each multisite installation.
    3. Assign a unique database for each multisite.
  2. Configure the Web Server:

    1. Create virtual hosts for each multisite installation in your web server configuration file (e.g., Apache's httpd.conf or Nginx's default.conf).
    2. Map the document root of each virtual host to the corresponding multisite directory.
  3. Create Settings.php Files:

    1. For each multisite, copy the default.settings.php file located in the "sites/default" directory.
    2. Rename the copied file to "settings.php" and place it in the respective multisite directory.
    3. Configure the database settings in each settings.php file to point to the unique database assigned to each multisite.
  4. Configure the Sites.php File:

    1. In the "sites" directory, create a file named "sites.php" if it doesn't already exist.
    2. Inside sites.php, define the mappings between site directories and domain names.
    3. For example:
      $sites['example.com'] = 'example.com';
      $sites['example2.com'] = 'example2.com';
      
  5. Enable Multisite Feature:

    1. Open the "sites/sites.php" file and uncomment the line that reads:
      // $settings['allow_authorize_operations'] = FALSE;
      
    2. Save the changes to sites.php.
  6. Set Up Domain Mapping (Optional):
    1. If you want to map domains to specific sites, you can install and configure the Domain Access module or similar domain mapping modules according to your requirements.
    2. By following these steps, you can set up a multisite configuration in Drupal 9. Each multisite installation will have its own separate directory, settings.php file, and database while sharing the core Drupal files. Remember to backup your files and databases before making any changes to your Drupal installation, especially when dealing with multisite configurations.

    3. Test and Verify:

      • Access the different domains mapped to your multisite installations in a web browser.
      • Ensure that each domain displays the corresponding site correctly without interfering with each other.
  • Log in to post comments

Comments

Article category

  • Drupal
  • Wordpress
  • Java
  • Javascipt
  • HTML
  • CSS
  • IOS
  • Android
  • PHP
  • MySQL
  • Other
  • Command line
  • NodeJs
  • Drupal 8
  • Drupal 7
  • GIT
  • DevOps
  • Python
  • Xampp
  • Server
  • Artificial intelligence
  • AppScript
  • Windows

Recent content

  • ERROR: Cannot create symbolic link : A required privilege is not held by the client.
    7 hours 14 minutes ago
  • Differences Between Bootstrap 3 & Bootstrap 4
    1 month ago
  • About Us
    1 month ago
  • Privacy Policy
    1 month ago
  • Create a Virtual Host on Xampp in 5 steps
    3 months ago
  • How to setup Multisite in drupal 9
    9 months ago
  • How to creating a FOR loop and a WHILE loop in JavaScript
    9 months ago
  • Calculator program HTML & PHP
    9 months ago
  • Algothrim to create a web application
    9 months ago
  • 10 Git Useful Commands for Every Developer
    9 months ago
© Copyright 2017 - 2026 key2Goal. All Rights Reserved