Media Wiki Installation: Difference between revisions
Line 184: | Line 184: | ||
Name | Name | ||
Name of wiki. For a new instance in production, use the production name. In case of a restoration, use the name of the old site. For details see: {{Internal|Media_Wiki_Concepts#Name_of_Wiki|Media Wiki Concepts | Name of Wiki}} | <span id='Name_of_Wiki'></span>Name of wiki. For a new instance in production, use the production name. In case of a restoration, use the name of the old site. For details see: {{Internal|Media_Wiki_Concepts#Name_of_Wiki|Media Wiki Concepts | Name of Wiki}} | ||
Project namespace: | Project namespace: |
Revision as of 01:46, 30 December 2023
External
- https://www.mediawiki.org/wiki/Compatibility
- https://www.mediawiki.org/wiki/Manual:Running_MediaWiki_on_Red_Hat_Linux
- https://releases.wikimedia.org/mediawiki/
Internal
Overview
A full new installation of the latest LTS (Long Term Support) Media Wiki instance is in most cases the best option, for both new deployments and restoration of older deployments from backup. This procedure has been written to support both new deployments and restoration of old deployments from backup and possibly upgrade into the new instance.
Pick the Latest LTS Release
Always install the latest LTS (Long Term Support) release.
Pick the latest LTS minor version from this pages:
Pick the latest patch version from this page, by navigating down the minor version folder and selecting the latest released patch:
The article was last updated for Media Wiki 1.39.6.
Install httpd
Install or upgrade to the newest stable httpd
version for your platform. The Media Wiki compatibility page does not recommend any specific httpd
version.
Installation instructions:
Install letsencrypt Certificates
The specific Media Wiki SSL and certificate configuration from /etc/httpd/conf.d/ssl.conf
(the Listen
directive and the only virtual host) and /etc/letsencrypt
or /etc/pki/tls
must be transferred manually from the backup file, after the web server and generic HTTPS support is installed.
No change in /etc/httpd/conf/httpd.conf
should be required. If the state of another wiki is restored, the restoration script will remind of the need to apply SSL configuration and the required steps.
PHP
PHP Installation
Select the newest compatible stable version from:
It is probably OK to install the latest stable PHP version even if it is not explicitly specified on the compatibility page. Media Wiki 1.39 works well with PHP 8.3 even if PHP 8.3 is not mentioned on the compatibility page.
Installation and httpd
configuration instructions:
PHP Configuration
Some PHP installations come with error reporting set to dump all errors, including some not appropriate for production, like deprecation messages.
Install MariaDB
Select the newest compatible stable version from:
It is probably OK to install the latest stable MariaDB version even if it is not explicitly specified on the compatibility page.
Installation and post-install configuration instructions:
Perform a New Instance Initialization
Regardless on whether we are installing a new Media Wiki instance to use it as such, or we intend do restore an old instance, a full new instance initialization is required in both cases.
Install the Media Wiki Release Files
Go to https://releases.wikimedia.org/mediawiki/, download the latest patch corresponding to the selected LTS release and expand it in the httpd
document root.
Create the Database
This procedure will create the Media Wiki dedicated database user and database. The difference between a new installation that will used as such and a new installation that will be used to restore an old instance is that in the former case the database and the user created now will be used in production. In the latter case, they will be eventually be discarded and deleted, to be replaced with the restored database and user.
⚠️ Do not use "=" as a password character.
New Instance in Production
For a new instance to be used in production, use valid, production values:
export MEDIAWIKI_USER=novaordis_wiki
export MEDIAWIKI_PASSWORD=... # Do not use "=" as a password character
export MEDIAWIKI_DATABASE=novaordis_wiki
export MARIADB_ROOT_PASSWORD=...
Instance Restoration
For a restoration:
export MEDIAWIKI_USER=tmp_mediawiki_user
export MEDIAWIKI_PASSWORD=tmp_mediawiki_passwd
export MEDIAWIKI_DATABASE=tmp_mediawiki_db
export MARIADB_ROOT_PASSWORD=...
DDL Commands
Connect to MariaDB using the database root password configured when the database cluster was installed. You will need console access to verify the result of the DDL operations.
From a terminal, execute the following DDL operations.
Create the Media Wiki user:
mysql -u root -p${MARIADB_ROOT_PASSWORD} -e "CREATE USER '${MEDIAWIKI_USER}'@'localhost' IDENTIFIED BY '${MEDIAWIKI_PASSWORD}';"
Create the Media Wiki database:
mysql -u root -p${MARIADB_ROOT_PASSWORD} -e "CREATE DATABASE ${MEDIAWIKI_DATABASE};"
Grant privileges to the database:
mysql -u root -p${MARIADB_ROOT_PASSWORD} -e "\
GRANT ALL PRIVILEGES ON ${MEDIAWIKI_DATABASE}.* TO '${MEDIAWIKI_USER}'@'localhost';\
FLUSH PRIVILEGES;\
COMMIT;"
Verify:
SHOW DATABASES;
SHOW GRANTS FOR '<your-user>'@'localhost';
exit
Configure httpd to Serve the Media Wiki Instance
Run the Initialization Procedure and Create LocalSettings.php
Connect to the newly installed web server with a web browser and perform the setup procedure. The procedure will create a LocalSettings.php
which will be download and installed manually in the server's document root.
The initial access should render something similar to:
Click "set up the wiki".
Language
Your language: en - English
Wiki language: en - English
Continue
Environmental checks: "The environment has been checked. You can install MediaWiki."
Continue
Connect to database
Database type: MariaDB, MySQL, or compatible
Database host: localhost
Database name (no hyphens). For a new instance in production use New Instance in Production MEDIAWIKI_DATABASE
values. For an instance restoration, use Instance Restoration MEDIAWIKI_DATABASE
value.
Database table prefix (no hyphens): leave empty.
Database username: For a new instance in production use New Instance in Production MEDIAWIKI_USER
values. For an instance restoration, use Instance Restoration MEDIAWIKI_USER
value.
Database password: For a new instance in production use New Instance in Production MEDIAWIKI_PASSWORD
values. For an instance restoration, use Instance Restoration MEDIAWIKI_PASSWORD
value.
Continue.
Database account for web access: Use the same account as for installation
Continue.
Name
Name of wiki. For a new instance in production, use the production name. In case of a restoration, use the name of the old site. For details see:
Project namespace:
Administrator account:
Post Restoration
Database Cleanup
Drop the temporary database and user:
DROP DATABASE tmp_mediawiki_db;
DROP USER 'tmp_mediawiki_user'@'localhost';
COMMIT;