Difference between revisions of "Information Systems:UniKB Wiki Technical Administration Guide"

From uniWIKI
Jump to navigation Jump to search
m
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  +
This page is updated for the migrated version of uniKB (on owl.unipharm.local).
=Overview=
+
==Overview==
This page describes the configuration of this wiki. uniKB, as with any other MediaWiki-based site, is a customized installation based on open-source software. This page is dedicated to outlining in detail these custom changes from the default configuration so that the wiki can be administered by any system administrator familiar with open-source software.
+
This page describes the configuration of this wiki. uniKB, as with any other MediaWiki-based site, is a customized installation based on open-source software. This page is dedicated to outlining in detail these custom changes from the default configuration so that the wiki can be administered by any system administrator with some familiarity with open-source software.
   
  +
==Administration==
=Installation=
+
===Installation and location===
The uniKB MediaWiki software is code that runs on top of Apache/MySQL/PHP. Please see [[uniPHARM eLearning Web Server Administration]] for more info.
 
  +
'''Important:''' If you're just looking for LocalSettings.php, it's located in /etc/mediawiki/
   
  +
Mediawiki is installed as a Debian package on owl.unipharm.local and therefore is easily managed with apt/aptitude. As per the Debian philosophy of stability over cutting-edge features, the Debian repository only contains the latets LTS (long-term support) version of Mediawiki.
=MediaWiki=
 
  +
==LocalSettings.php==
 
  +
Location of important files:
This very important file is the main configuration file for MediaWiki. The server reads this file in real-time and operates accordingly. Any changes made to this file is automatically applied when the file is saved, and thus a single mistyped character can take down the entire wiki (rather than being scary, this also means it's relatively easy to fix a downed wiki).
 
  +
===Customizations===
 
  +
* /var/lib/mediawiki is the site root. This location is often referred to as /var/www/mediawiki in documentation.
====Timezone====
 
  +
:* Most of the contents of this folder are symlinked to other locations in the filesystem (this is a Debian thing I guess). Most of the symlinks are to /usr/share/mediawiki.
$wgLocaltimezone was added to correct time displayed in wiki (edit timestamps etc.)
 
  +
:* However, additional files such as non-base extensions and images, are physically located in this folder.
  +
* As mentioned, /usr/share/mediawiki contains the physical files of the base installation.
  +
* As mentioned above, the main configuration file for mediawiki, LocalSettings.php, is located in /etc/mediawiki
  +
* /etc/mediawiki also contains the Apache configuration for the site (mediawiki.conf). There is a symlink to this file in /etc/apache2.
  +
* If you encounter file access errors in /var/lib/mediawiki, try accessing the files directly at their location
  +
  +
Installing the package also installs the necessary dependencies: Apache web server, PHP v7, MariaDB (MySQL), memcached. Apache and PHP configuration is also done for you.
  +
  +
Check [[Information Systems:Owl LAMP server|Owl LAMP server]] for notes on managing the server side of things.
  +
 
===LocalSettings.php===
 
This very important file is the main configuration file for MediaWiki. The server reads this file in real-time and operates accordingly. Any changes made to this file is automatically applied when the file is saved and the page is refreshed, and thus a single mistyped character can take down the entire wiki (but rather than this being scary, this also means it's relatively easy to fix a downed wiki). Changes to the wiki installation and configuration are summarized in the [[Information Systems:uniKB Changelog|uniKB Changelog]], but detailed explanations for changes to LocalSettings.php can be found in this section.
  +
  +
===Namespaces===
  +
uniKB utilizes Mediawiki namespaces to provide some separation for the content of each department. These are defined in LocalSettings.php. The following table outlines the namespaces are their corresponding departments.
  +
{| class="wikitable"
  +
|+ Custom namespace names and IDs.
  +
!Namespace!!ID
  +
|-
  +
|Accounting
  +
|3000
  +
|-
  +
|Accounting Talk
  +
|3001
  +
|-
  +
|Purchasing
  +
|3002
  +
|-
  +
|Purchasing Talk
  +
|3003
  +
|-
  +
|Information Systems
  +
|3004
  +
|-
  +
|Information Systems Talk
  +
|3005
  +
|-
  +
|}
   
 
==Extensions==
 
==Extensions==
  +
Extensions are modules that extend the functionality of Mediawiki. We try to implement only extensions that are in the stable status and that provide good value to the site. Otherwise, there are a lot of bad extensions that jeopardize the upgradeability (e.g. when they become unmaintained) and performance (if its not coded well) of the site. The ones used are listed below:
Extensions are a major part of MediaWiki. As with most community-driven, open-source projects, the principle of having extensions is to separate the code for add-ons from the core code, which is what is officially supported by the community developers of the main project. The downside of this structure is that extensions that become relied upon can have a lack of support as they are maintained by third-parties. Extensions can also conflict with each other, as well as break after upgrades to the core software. Thus it is fragile practice to maintain and upgrade a customized instance of open-source software like this wiki, and caution must be exercised to ensure all functionality survives an upgrade. The extensions installed on uniKB are discussed below, mainly in order of decreasing importance.
 
  +
  +
* LDAPAuthentication2: For integrating the site with Active Directory to allow users to sign on via their AD credentials and for mapping AD groups to wiki groups (for permissions and preferences). This is actually a suite of related extensions, including PluggableAuth, LDAPAuthorization, LDAPUserInfo etc. [[https://www.mediawiki.org/wiki/Manual:Active_Directory_Integration|Read here]] for more info regarding AD integration.
  +
* CirrusSearch/Elastica: This improves the search function of the site by using elasticsearch (must be installed separately) as the search backend. This came as a highly recommended extension and therefore it was installed (although setup is a little finicky).
  +
* MobileFrontend: Provides a responsive site for mobile users. This is what Wikipedia uses to enable its mobile site.
  +
  +
Note: Over time, select extensions are integrated into base by the Mediawiki team due to their usefulness.
  +
  +
==Troubleshooting==
  +
===Login issue caused by memcached===
  +
If you see the issue below, try issuing <code>systemctl restart memcached</code>.
  +
  +
[[File:mediawiki-login-issue.gif|300px]]
  +
  +
===Debug LocalSettings.php===
  +
If the site is crashing and you need to debug, try uncommenting the following lines of code at the top of LocalSettings.php:
  +
  +
[[File:2020-12-21 11_30_17-_LocalSettings.php - Notepad++.png|300px]]
   
  +
Don't forget to re-comment these lines after.
====LDAP Authentication====
 
Extension page:
 
   
  +
===PluggableAuthentication Error===
====Maintenance====
 
  +
Changes to Active Directory OUs may need to be reflected in <code>/var/lib/mediawiki/extensions/ldap.json</code>. This is the config file for the LDAP authentication module that allows users to authenticate via their AD credentials.
   
  +
[[Category: uniKB Wiki]]
====Breadcrums2====
 
Extension page: https://www.mediawiki.org/wiki/Extension:BreadCrumbs2
 

Latest revision as of 13:35, 5 July 2021

This page is updated for the migrated version of uniKB (on owl.unipharm.local).

Overview

This page describes the configuration of this wiki. uniKB, as with any other MediaWiki-based site, is a customized installation based on open-source software. This page is dedicated to outlining in detail these custom changes from the default configuration so that the wiki can be administered by any system administrator with some familiarity with open-source software.

Administration

Installation and location

Important: If you're just looking for LocalSettings.php, it's located in /etc/mediawiki/

Mediawiki is installed as a Debian package on owl.unipharm.local and therefore is easily managed with apt/aptitude. As per the Debian philosophy of stability over cutting-edge features, the Debian repository only contains the latets LTS (long-term support) version of Mediawiki.

Location of important files:

  • /var/lib/mediawiki is the site root. This location is often referred to as /var/www/mediawiki in documentation.
  • Most of the contents of this folder are symlinked to other locations in the filesystem (this is a Debian thing I guess). Most of the symlinks are to /usr/share/mediawiki.
  • However, additional files such as non-base extensions and images, are physically located in this folder.
  • As mentioned, /usr/share/mediawiki contains the physical files of the base installation.
  • As mentioned above, the main configuration file for mediawiki, LocalSettings.php, is located in /etc/mediawiki
  • /etc/mediawiki also contains the Apache configuration for the site (mediawiki.conf). There is a symlink to this file in /etc/apache2.
  • If you encounter file access errors in /var/lib/mediawiki, try accessing the files directly at their location

Installing the package also installs the necessary dependencies: Apache web server, PHP v7, MariaDB (MySQL), memcached. Apache and PHP configuration is also done for you.

Check Owl LAMP server for notes on managing the server side of things.

LocalSettings.php

This very important file is the main configuration file for MediaWiki. The server reads this file in real-time and operates accordingly. Any changes made to this file is automatically applied when the file is saved and the page is refreshed, and thus a single mistyped character can take down the entire wiki (but rather than this being scary, this also means it's relatively easy to fix a downed wiki). Changes to the wiki installation and configuration are summarized in the uniKB Changelog, but detailed explanations for changes to LocalSettings.php can be found in this section.

Namespaces

uniKB utilizes Mediawiki namespaces to provide some separation for the content of each department. These are defined in LocalSettings.php. The following table outlines the namespaces are their corresponding departments.

Custom namespace names and IDs.
Namespace ID
Accounting 3000
Accounting Talk 3001
Purchasing 3002
Purchasing Talk 3003
Information Systems 3004
Information Systems Talk 3005

Extensions

Extensions are modules that extend the functionality of Mediawiki. We try to implement only extensions that are in the stable status and that provide good value to the site. Otherwise, there are a lot of bad extensions that jeopardize the upgradeability (e.g. when they become unmaintained) and performance (if its not coded well) of the site. The ones used are listed below:

  • LDAPAuthentication2: For integrating the site with Active Directory to allow users to sign on via their AD credentials and for mapping AD groups to wiki groups (for permissions and preferences). This is actually a suite of related extensions, including PluggableAuth, LDAPAuthorization, LDAPUserInfo etc. [here] for more info regarding AD integration.
  • CirrusSearch/Elastica: This improves the search function of the site by using elasticsearch (must be installed separately) as the search backend. This came as a highly recommended extension and therefore it was installed (although setup is a little finicky).
  • MobileFrontend: Provides a responsive site for mobile users. This is what Wikipedia uses to enable its mobile site.

Note: Over time, select extensions are integrated into base by the Mediawiki team due to their usefulness.

Troubleshooting

Login issue caused by memcached

If you see the issue below, try issuing systemctl restart memcached.

mediawiki-login-issue.gif

Debug LocalSettings.php

If the site is crashing and you need to debug, try uncommenting the following lines of code at the top of LocalSettings.php:

2020-12-21 11 30 17- LocalSettings.php - Notepad++.png

Don't forget to re-comment these lines after.

PluggableAuthentication Error

Changes to Active Directory OUs may need to be reflected in /var/lib/mediawiki/extensions/ldap.json. This is the config file for the LDAP authentication module that allows users to authenticate via their AD credentials.