Skip to content

MediaWiki

Endi S. Dewata edited this page Sep 22, 2023 · 1 revision

Prerequisites

MediaWiki requires the following PHP version (see compatibility list):

  • PHP 5.3: MediaWiki 1.13 - 1.26

  • PHP 5.4: MediaWiki 1.17 - 1.26

  • PHP 5.5: MediaWiki 1.18 -

  • PHP 5.6: MediaWiki 1.23 -

  • PHP 7.0: MediaWiki 1.27 -

Installation

MediaWiki can be downloaded as follows:

$ git clone https://github.com/wikimedia/mediawiki.git
$ cd mediawiki
$ git checkout -b REL1_25 origin/REL1_25

Since version 1.24 the skin has to be cloned separately:

$ cd skins
$ rm .gitignore
$ git clone https://github.com/wikimedia/mediawiki-skins-MonoBook --branch REL1_25 --single-branch MonoBook
$ cd MonoBook
$ rm -rf .git

Since version 1.27 the skin has to be updated from submodule:

$ git submodule update --init -- skins/MonoBook

To merge the submodule:

$ mv skins/MonoBook skins/MonoBook.tmp
$ git submodule deinit -f -- skins/MonoBook
$ rm -rf .git/modules/skins/MonoBook
$ rm -rf skins/MonoBook
$ rm -rf skins/.gitignore
$ mv skins/MonoBook.tmp skins/MonoBook

Then modify LocalSettings.php to load the skin:

wfLoadSkin( 'MonoBook' );

See also:

Configuration

Open http://server.example.com and follow the instruction. Download and install LocalSettings.php.

Base URL

Base URL is configured as follows:

$wgServer = "//".$_SERVER[HTTP_HOST];

Database Connection

Database connection is configured as follows:

$wgDBtype = "mysql";
$wgDBserver = $_ENV['OPENSHIFT_MYSQL_DB_HOST'].":".$_ENV['OPENSHIFT_MYSQL_DB_PORT'];
$wgDBname = $_ENV['OPENSHIFT_APP_NAME'];
$wgDBuser = $_ENV['OPENSHIFT_MYSQL_DB_USERNAME'];
$wgDBpassword = $_ENV['OPENSHIFT_MYSQL_DB_PASSWORD'];

Customization

Sidebar

Edit MediaWiki:Sidebar, enter:

* SEARCH
* navigation
** mainpage|Home
** PKI_Documentation|Documentation
** PKI_FAQ|FAQ
** PKI_Users|Users
** PKI_Developers|Developers
** PKI_Download|Download
** PKI_Bugs|Bugs
** recentchanges-url|recentchanges
* TOOLBOX
* LANGUAGES

See also MediaWiki:Sidebar.

Elements

  • content

  • p-cactions

  • p-personal

  • p-logo

  • p-navigation

  • p-search

  • p-tb

Maintenance

Locking

To lock wiki add the following lines into LocalSettings.php:

$wgReadOnly = 'This wiki is currently under maintenance.';

To unlock wiki restore the original LocalSettings.php.

See also:

Upgrading

To upgrade wiki:

$ cd maintenance
$ php update.php

See also Update.php.

Database Cleanup

To list users:

mysql> select user_id, user_name, user_email from user order by user_name;

To list user groups:

mysql> select user_name, user_email, ug_group from user left join user_groups on user_id = ug_user order by user_name;

Exporting MediaWiki Pages

$ dnf install pandoc mariadb-connector-c-devel
$ pip install mariadb sphinx

See Also