Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

mainframe98/MediaWiki-Family-Configuration-Example

Repository files navigation

An example MediaWiki Wiki family configuration

This is an example configuration for a MediaWiki family from scratch. Existing wikis should use a different approach, such as CentralAuth. This document solely focuses on the configuration of MediaWiki. For a guide that also covers the other aspects, see this page on MediaWiki.org.

Directory and file structure

  • LocaLSettings.php contains the part that determines the database name, or redirects the user to an error page.
  • CommonSettings.php contains the settings that are the same across all wikis.
  • ConditionalCommonSettings.php contains the settings that are shared across many wikis, but may be toggled on or off on request. Their functionality depends on a configuration variable from InitialiseSettings.php.
  • InitialiseSettings.php contains the settings per wiki. The settings are set per wiki by database name, per group by suffix or tag, or with the special identifier default, which sets the default for all wikis, unless overridden.
  • SharedExtensions.php contains the extensions that are loaded for all wikis and their configuration.
  • LocalExtensions.php contains the extensions that may be shared across wikis, but may be toggled on or off on request. Their functionality depends on a configuration variable from InitialiseSettings.php.
  • Skins.php contains the skins that can be used by the wikis. Aside from the default skin, they may be toggled on or off on request. Their functionality depends on a configuration variable from InitialiseSettings.php.
  • PrivateSettings.php contains the settings that should remain private. An example can be found in PrivateSettings.php-example
  • suffixes.list contains the different suffixes wikis may have.
  • WikiNotFound404.php contains an 404 page to be displayed when the requested wiki does not exist.

dblists

This directory contains all database lists. The file structure is 1 database per line.

  • all.dblist contains all known databases. This file uses a different structure than the others as it also contains the site name and language code, separated by a pipe (|).

tags

Database lists in this folder are in the same format as in the parent folder. Databases listed in one or more of these files are tagged. The tag, such as 'echo', from echo.dblist, indicates that the wiki uses the extension Echo. This is used for configuration variables or extensions that are used on many wikis. The file name indicates the name of the tag, excluding the file extension. So for the earlier example, the dblist echo.dblist lists wikis where the tag 'echo' applies. The tag is set as a group in InitialiseSettings.php, similar to wiki suffixes.

  • echo.dblists contains all wikis that use the extension Echo.
  • closed.dblist contains all wikis that are closed, which means they cannot be edited by those who are not stewards.
  • loginonly.dblist contains all wikis that require an account to edit.
  • restricted.dblist contains all wikis that require being invited to edit, but the content may be viewed freely.
  • private.dblist contains all wikis that may only be read and edited by selected users, and stewards.

Using this example

To use this example, there are a few things you must do:

  1. Clone this repository to a suitable location, such as the MediaWiki installation folder.
  2. Create a PrivateSettings.php file. An example is provided, see PrivateSettings.php-example.
  3. Install a fresh copy of MediaWiki to use as a template. Place the LocalSettings.php file that is generated by the installer in the MediaWiki installation and edit the wiki to improve the template. Remove the LocalSettings.php file after you are done. It may contain some useful auto generated settings about your environment that you may want to put in CommonSettings.php.
  4. Export the template with a backup or dump program, such as mysqldump or phpMyAdmin.
  5. Create the central wiki. For this example, this is metawiki, if you use another name, you will need to adjust the configuration ($wgSharedDBname) to use that name! You can either reinstall MediaWiki or restore the template under a different database name.
  6. Set the settings for the central wiki in InitialiseSettings.php, where necessary.
  7. Link LocalSettings.php from the main MediaWiki installation, either by creating a php file with the content <?php require_once( "$IP/config/LocalSettings.php" );, assuming the configuration folder is created in the MediaWiki installation, or by creating a symlink.

Adding a new wiki

To add a new wiki, you need to take the following steps:

  1. Create a new database based on a template database for the new wiki. The database name should be the sub domain with a suffix, so for meta.example.org, this would be metawiki. For a group of wikis that use a different domain, rather than your main domain, add the suffix to LocalSettings.php, and update suffixes.list with the new suffix.
  2. Add the database to all.dblist. The database name comes first, then the site name, and finally the language code. For meta.example.org, this would be metawiki|Meta Wiki|en.
  3. (Optional) Configure the site specific settings in InitialiseSettings.php.
  4. (Optional) If the wiki is login only, restricted or private, add the database to loginonly.dblist, restricted.dblist or private.dblist respectively.

About

An example of a MediaWiki family configuration

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages