You are browsing a read-only backup copy of Wikitech. The primary site can be found at wikitech.wikimedia.org
Configuration files: Difference between revisions
imported>BryanDavis (/a/common -> /srv/mediawiki-staging; /usr/local/apache/common -> /srv/mediawiki) |
imported>Alex Monk No edit summary |
||
Line 17: | Line 17: | ||
</source> | </source> | ||
Some random useful facts: | Some random useful facts: | ||
* The wiki names used in the keys are database names and are listed in <code> | * The wiki names used in the keys are database names and are listed in <code>all.dblist</code> | ||
* There is a dblist for every wiki family (wikipedia, wikibooks, ...) as well as <code>'private'</code> for private wikis and a few others. See <code> | * There is a dblist for every wiki family (wikipedia, wikibooks, ...) as well as <code>'private'</code> for private wikis and a few others. See <code>*.dblist</code> to see what's available | ||
** After updating a dblist, run <code>sync-dblist</code> to sync the change | ** After updating a dblist, run <code>sync-dblist</code> to sync the change | ||
* When multiple values apply to one wiki, the most specific one wins (i.e. wiki name beats dblist beats <code>'default'</code>) | * When multiple values apply to one wiki, the most specific one wins (i.e. wiki name beats dblist beats <code>'default'</code>) | ||
Line 27: | Line 27: | ||
This file includes "configuration code", i.e. configuration that can't be done with simple variable assignments. This includes extensions, dynamic things and a whole lot of other random things that have been piling up here in the past years. | This file includes "configuration code", i.e. configuration that can't be done with simple variable assignments. This includes extensions, dynamic things and a whole lot of other random things that have been piling up here in the past years. | ||
When adding a new extension, you should put its setup code (<code>require_once()</code> plus any other settings) here in an <code>if ( $wmgEnableMyExtension )</code> block. | When adding a new extension, you should put its setup code (<code>require_once()</code> plus any other settings) here in an <code>if ( $wmgEnableMyExtension )</code> block (assuming it's not going to just be enabled everywhere). | ||
== extension-list and ExtensionMessages-XXX.php == | == extension-list and ExtensionMessages-XXX.php == | ||
All of our wikis share the same localization cache, but in normal setups this causes problems when the cache is shared between wikis with different sets of enabled extensions. We work around this by listing all extensions enabled on any wiki explicitly. | All of our wikis share the same localization cache, but in normal setups this causes problems when the cache is shared between wikis with different sets of enabled extensions. We work around this by listing all extensions enabled on any wiki explicitly. | ||
<code>extension-list</code> lists the paths to the extension setup file (NOT the i18n file!) of every extension enabled on any wiki. The paths start with <code>$IP/extensions</code> and each path is on a line by itself: | <code>wmf-config/extension-list</code> lists the paths to the extension setup file (NOT the i18n file!) of every extension enabled on any wiki (except wikitech). The paths start with <code>$IP/extensions</code> and <code>$IP/skins</code> and each path is on a line by itself: | ||
<pre> | <pre> | ||
$IP/extensions/AbuseFilter/AbuseFilter.php | $IP/extensions/AbuseFilter/AbuseFilter.php | ||
Line 38: | Line 38: | ||
$IP/extensions/AntiBot/AntiBot.php | $IP/extensions/AntiBot/AntiBot.php | ||
... | ... | ||
</pre> | $IP/skins/Vector/Vector.php</pre> | ||
<code>ExtensionMessages-''1.NN''wmf''MM''.php</code> is a PHP file that contains the actual workaround. <code>mw-update-l10n</code> rebuilds it from <code>extension-list</code>. You can run it yourself to check for errors. You must use wiki that is deployed to the correct version. | <code>ExtensionMessages-''1.NN''wmf''MM''.php</code> is a PHP file that contains the actual workaround. <code>mw-update-l10n</code> rebuilds it from <code>wmf-config/extension-list</code>. You can run it yourself to check for errors. You must use wiki that is deployed to the correct version. | ||
<pre> | <pre> | ||
$ cd /srv/mediawiki-staging/wmf-config | $ cd /srv/mediawiki-staging/wmf-config | ||
Line 49: | Line 49: | ||
== Other files == | == Other files == | ||
* <code>abusefilter.php</code>: configuration for the AbuseFilter extension | * <code>abusefilter.php</code>: configuration for the AbuseFilter extension | ||
* <code> | * <code>db-*.php</code>: Defines which wikis are in which section, which database servers are in which section, etc., etc., useful as a reference for DB-related facts like those. Don't mess with this file unless you know what you're doing | ||
* | |||
* <code>flaggedrevs.php</code>: configuration for the FlaggedRevs extension | * <code>flaggedrevs.php</code>: configuration for the FlaggedRevs extension | ||
* <code>liquidthreads.php</code>: configuration for the LiquidThreads extension | * <code>liquidthreads.php</code>: configuration for the LiquidThreads extension | ||
* <code>mc.php</code>: configuration for memcached, mostly a list of available memcached servers | * <code>mc.php</code>: configuration for memcached, mostly a list of available memcached servers | ||
* <code>missing.php</code>: generates the "This wiki doesn't exist" page. Not really a configuration file | * <code>missing.php</code>: generates the "This wiki doesn't exist" page. Not really a configuration file | ||
* <code>wmf-config/PrivateSettings.php</code>: passwords and other non-public things | * <code>wmf-config/PrivateSettings.php</code>: passwords and other non-public things - the real git repository containing this file is on <code>tin</code> at <code>/srv/mediawiki-staging/private</code>. Please commit changes there. | ||
* <code>wgConf.php</code>: setup code for the configuration system | * <code>wgConf.php</code>: setup code for the configuration system |
Revision as of 23:09, 4 July 2015
See also: How to do a configuration change, Heterogeneous deployment.
![]() | This page may be outdated or contain incorrect details. Please update it if you can. |
Our configuration lives in /srv/mediawiki-staging/wmf-config
on the deployment host 'tin', and tools such as scap
sync this directory to /srv/mediawiki
on cluster hosts.
(The same common directory also has subdirectories for each live branch of the MediaWiki codebase.)
Many configuration files are in the subdirectory wmf-config
.
Most files are maintained in the git repository operations/mediawiki-config.
InitialiseSettings.php
InitialiseSettings.php
contains a huge array of settings. The format, roughly, is
'wgDefaultSkin' => array( // Variable name, without the $
'default' => 'vector', // Default value, use 'wiki' instead of 'default' to set the value for Wikipedias
'nostalgiawiki' => 'nostalgia', // Value for a specific wiki
'wikibooks' => 'monobook', // Value for all wikis listed in /home/wikipedia/common/wikibooks.dblist
// etc.
),
Some random useful facts:
- The wiki names used in the keys are database names and are listed in
all.dblist
- There is a dblist for every wiki family (wikipedia, wikibooks, ...) as well as
'private'
for private wikis and a few others. See*.dblist
to see what's available- After updating a dblist, run
sync-dblist
to sync the change
- After updating a dblist, run
- When multiple values apply to one wiki, the most specific one wins (i.e. wiki name beats dblist beats
'default'
) - We often use variables starting with
$wmg
to trigger certain blocks of code inCommonSettings.php
(e.g. enabling extensions with$wmgEnableMyExtension
) - Extension configuration variables don't work here because the extension setup file will set them back to the defaults; when we do want to configure them here, we'll set
'wmgMyExtensionThingy'
instead, then inCommonSettings.php
set$wgMyExtensionThingy = $wmgMyExtensionThingy;
after including the extension setup file.
CommonSettings.php
This file includes "configuration code", i.e. configuration that can't be done with simple variable assignments. This includes extensions, dynamic things and a whole lot of other random things that have been piling up here in the past years.
When adding a new extension, you should put its setup code (require_once()
plus any other settings) here in an if ( $wmgEnableMyExtension )
block (assuming it's not going to just be enabled everywhere).
extension-list and ExtensionMessages-XXX.php
All of our wikis share the same localization cache, but in normal setups this causes problems when the cache is shared between wikis with different sets of enabled extensions. We work around this by listing all extensions enabled on any wiki explicitly.
wmf-config/extension-list
lists the paths to the extension setup file (NOT the i18n file!) of every extension enabled on any wiki (except wikitech). The paths start with $IP/extensions
and $IP/skins
and each path is on a line by itself:
$IP/extensions/AbuseFilter/AbuseFilter.php $IP/extensions/AjaxTest/AjaxTest.php $IP/extensions/AntiBot/AntiBot.php ... $IP/skins/Vector/Vector.php
ExtensionMessages-1.NNwmfMM.php
is a PHP file that contains the actual workaround. mw-update-l10n
rebuilds it from wmf-config/extension-list
. You can run it yourself to check for errors. You must use wiki that is deployed to the correct version.
$ cd /srv/mediawiki-staging/wmf-config $ mwscript mergeMessageFileList.php --wiki=testwiki --list-file=extension-list --output=/tmp/junkExtensionMessages.php
After running this, check the output for error messages, and diff it with the current ExtensionMessages.php
to verify the changes are sane.
Other files
abusefilter.php
: configuration for the AbuseFilter extensiondb-*.php
: Defines which wikis are in which section, which database servers are in which section, etc., etc., useful as a reference for DB-related facts like those. Don't mess with this file unless you know what you're doingflaggedrevs.php
: configuration for the FlaggedRevs extensionliquidthreads.php
: configuration for the LiquidThreads extensionmc.php
: configuration for memcached, mostly a list of available memcached serversmissing.php
: generates the "This wiki doesn't exist" page. Not really a configuration filewmf-config/PrivateSettings.php
: passwords and other non-public things - the real git repository containing this file is ontin
at/srv/mediawiki-staging/private
. Please commit changes there.wgConf.php
: setup code for the configuration system