Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/unlcms/unl_multisite
Drupal module to run multisite with a UI and without the need to make symlinks
https://github.com/unlcms/unl_multisite
Last synced: about 2 months ago
JSON representation
Drupal module to run multisite with a UI and without the need to make symlinks
- Host: GitHub
- URL: https://github.com/unlcms/unl_multisite
- Owner: unlcms
- License: gpl-2.0
- Created: 2017-03-27T18:33:52.000Z (almost 8 years ago)
- Default Branch: 8.x-1.x
- Last Pushed: 2024-10-07T20:10:33.000Z (3 months ago)
- Last Synced: 2024-10-07T21:09:49.535Z (3 months ago)
- Language: PHP
- Homepage:
- Size: 166 KB
- Stars: 0
- Watchers: 7
- Forks: 2
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# UNL Multisite Module for Drupal 8/9/10
Provides a web interface to run a [Drupal multisite](https://www.drupal.org/docs/multisite-drupal) 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);
```2. Copy .htaccess-subsite-map.txt.sample to the web root and rename to .htaccess-subsite-map.txt
3. Set the location of your config directory in sites/default/settings.php - [See Drupal.org for help](https://www.drupal.org/docs/8/configuration-management/changing-the-storage-location-of-the-sync-directory)
```
$settings['config_sync_directory'] = '../config/sync';
```4. 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
```5. Add this to .htaccess at the web root (inside the block).
```
# START unl_multisite SECTION
# Add the following line to your httpd.conf where is the file system path to the Drupal web root.
# RewriteMap drupal_unl_multisite txt:/.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
```6. Add the following line to your Apache's configuration file (httpd.conf) where is the file system path to the Drupal web root. Restart Apache afterward.
```
RewriteMap drupal_unl_multisite txt:/.htaccess-subsite-map.txt
```7. Set up a cron job on the server to execute unl_multisite/cron.php on a regular basis.
8. 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.