MediaWiki

Prerequisite
Before using this guide, you will need
 * MariaDB as a database
 * Nginx as a webserver
 * A domain name for your wiki pointing to your server. We will use wiki.example.org in this guide.

Get source
Get the link to the latest stable version from MediaWiki

Configure PHP
Edit file   and add folder   to the   setting.

Configure
/mw-config

ParserFunctions
This extension is bundled by default with MediaWiki. You just need to activate it.

Add the line  to the file

SyntaxHighlight
This extension is bundled by default with MediaWiki. You just need to activate it.

Add the line  to the file

TemplateData
Allows you to describe your templates using structured data for a better experience with the VisualEditor.

https://www.mediawiki.org/wiki/Extension:TemplateData

Parsoid
The VisualEditor extension require Parsoid to be installed.

Install
The project is still you and instruction might change. See mediawiki instructions.

Connect to MediaWiki
Edit configuration in  and change the following lines

If you have changed the listening port of your webserver (you are using sslh), you might need to change the  in the line above.

You can check your ports using Parsoid seems to pick the IPV4 port. 4433 in this case

Restarting
After changing the config, you need to restart Parsoid.

php-curl
VisualEditor require the curl PHP extension

MobileFrontend
Because a lot of your traffic will come from mobile devices.


 * Download MobileFrontend
 * Extract it in
 * Add the following to

For more information, check the extension documentation

Cite
This extension is bundled by default with MediaWiki. You just need to activate it.

Add the line  to the file

TitleKey
The TitleKey extension allows search suggestion to be case insensitive.
 * Download extension from https://www.mediawiki.org/wiki/Special:ExtensionDistributor/TitleKey
 * Unzip the extension in
 * Add the line   to the file
 * Create tables by running the following commands

Speedup
By default the MediaWiki installation is pretty slow.

Localisation cache
Uncomment the line about  in.

Enable CronJob
First create the log file Then add the following line in  Finally you can disable jobs running on user visits in   You can check the number of jobs in the queue at https://wiki.example.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=jsonfm

Canonical links
Page in MediaWiki can be accessed by several URLs. For example the main page of this wiki can be accessed with To avoid issues with duplicated content in search engines, it is possible to add a canonical link to all pages
 * https://wiki.meurisse.org/
 * https://wiki.meurisse.org/wiki/Main_Page
 * https://wiki.meurisse.org/index.php?title=Main_Page
 * https://wiki.meurisse.org/index.php?title=Main_Page&mobileaction=toggle_view_desktop

Capital Links
By default, MediaWiki forces the first letter of a page title to be upper case. The advantage of it is that you can omit the first capital in links,

Eg. You have a page named. You can link to it like.

The drawback is that you can't create a page with lower case title.

Change that in.

Footer
By default the footer contain several links that we want to configure.

Licence
The license is controlled by these parameters The text of the link itself is the content of the page https://wiki.example.org/wiki/MediaWiki:Copyright

About / Disclaimers / Privacy
The three other default links in the footer are controlled by this pages:

https://wiki.example.org/wiki/MediaWiki:Aboutsite

https://wiki.example.org/wiki/MediaWiki:Disclaimers

https://wiki.example.org/wiki/MediaWiki:Privacy

To remove one of the link set the content of the page to.

No-nofollow
By default MediaWiki adds  to all external links. While it's usage for real wikis is discussed, it is counterproductive for a personal wiki. It can be disabled in.

Subpages
Subpages are only enabled for some namespaces. Others can be enabled in.

Page Title
allows you to change the title of a page (the default is to use the same as the URL). However by default only minor changes are allowed like the case of the title.

If you want to do more changes to the page title (eg. keep a short URL but have an explicit title like this page), you can enable this

Sitemap
SItemaps are good for SEO as they allow search engines to find pages faster on your site.

Mediawiki comes included with a script that can generate the sitemaps files; but it requires a bit of setup before using it.
 * 1) In   add the following lines
 * 2) Create a folder named   at the root of your installation
 * 3) Add this line to   You can also force an initial generation of the sitemap files using this command
 * 4) Your sitemap will then be accessible at https://wiki.example.org/sitemap/sitemap-index-wiki.xml
 * 5) Add this sitemap in the webmaster tools of the targeted search engines