Code Monkey home page Code Monkey logo

unl_multisite's Introduction

UNL Multisite Module for Drupal 8/9/10

Provides a web interface to run a Drupal multisite setup so additional sites can exist in subdirectories such as http://example.unl.edu/site2.

Installation

  1. Insert the following line into index.php after $request is initialized:

require_once './modules/contrib/unl_multisite/bootstrap.inc';

Your index.php file should look like:

$request = Request::createFromGlobals();
require_once './modules/contrib/unl_multisite/bootstrap.inc';
$response = $kernel->handle($request);
  1. Copy .htaccess-subsite-map.txt.sample to the web root and rename to .htaccess-subsite-map.txt

  2. Set the location of your config directory in sites/default/settings.php - See Drupal.org for help

$settings['config_sync_directory'] = '../config/sync';
  1. Copy sites/example.sites.php to sites/sites.php and add this to the end of the file:
  /**
   * Stub for the unl_multisite module to generate site aliases.
   */
  # THIS SECTION IS AUTOMATICALLY GENERATED
  # DO NOT EDIT!!!!

  # %UNL_CREATION_TOOL_STUB%

  # END OF AUTOMATICALLY GENERATED AREA
  1. Add this to .htaccess at the web root (inside the block).
  # START unl_multisite SECTION
  # Add the following line to your httpd.conf where <DRUPAL_ROOT> is the file system path to the Drupal web root.
  # RewriteMap drupal_unl_multisite txt:<DRUPAL_ROOT>/.htaccess-subsite-map.txt
  # Do not uncomment the previous line.
  RewriteRule .*/cron.php cron.php
  RewriteRule .*/update.php update.php
  RewriteRule ^(.*?/(core\/assets|core\/misc|core\/modules|core\/themes|libraries|modules|sites|themes))(.*) ${drupal_unl_multisite:$1|$1}$3 [DPI]

  RewriteCond ${drupal_unl_multisite://%{HTTP_HOST}%{REQUEST_URI}|NOT_FOUND} !^NOT_FOUND$
  RewriteRule (.*) ${drupal_unl_multisite://%{HTTP_HOST}%{REQUEST_URI}|$1} [R,L]
  # END unl_multisite SECTION
  1. Add the following line to your Apache's configuration file (httpd.conf) where <DRUPAL_ROOT> is the file system path to the Drupal web root. Restart Apache afterward.
  RewriteMap drupal_unl_multisite txt:<DRUPAL_ROOT>/.htaccess-subsite-map.txt
  1. Set up a cron job on the server to execute unl_multisite/cron.php on a regular basis.

  2. Ensure the MYSQL database user for the default site has privileges to create new databases.

Troubleshooting

  • Drush and MariaDB 10.7+ don't work with a database port set if the host is localhost. If you are using localhost for the host, clear the port setting in settings.php.

unl_multisite's People

Contributors

ericras avatar mfairchild365 avatar tsteiner avatar macburgee1 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.