📜 ⬆️ ⬇️

Organization of Wikimedia Commons analogue for own Wiki

Wiki engines are widely distributed on the Internet. Wiki markup and many convenient extensions allow you to cover a wide range of tasks: from creating a page for personal notes to a corporate knowledge center.

Suppose your path is to install a wiki on a shared hosting. This solution is found quite often - you do not need to raise Apache and configure MySQL, and for individual hosting sites and suffer from ocaml and latex. Access to a virtual server is often more reliable than access to a corporate one.

There are two minuses in this decision:
1) Wiki itself provokes the writing of documentation, which leads to its quite rapid growth. As a result, we run into restrictions on the amount of available disk space of paid hosting.
2) To place on corporate servers some corporate files - not feng shui.

We can solve our problems by storing all the files attached to the wiki pages (pictures, pdf, measurement telemetry, etc.) on the production server.
')
MediaWiki allows the implementation of this concept without additional dancing with a tambourine.

We install on the working MediaWiki server. In my case, the server was a weak QNAP (network storage system (NAS)) with a constant external IP. It runs Apache and MySQL from the factory, a two-disk RAID. But linux is quite stripped down, which does not allow you to quickly assemble a full-fledged latex, ocalm, etc., and therefore full use of MediaWiki.

In MediaWiki on QNAP, we allow uploading files, for which we add / change in LocalSettings.php:
$wgEnableUploads = true;
$wgCheckFileExtensions = false;


Customize user rights on your own.

In MediaWiki on a paid host, add in a similar file:
$wgForeignFileRepos[] = array(
'class' => 'ForeignAPIRepo',
'name' => 'servercommon', # , ...
'apibase' => 'http://YOURFILESERVER/wiki/api.php', # API QNAP
'hashLevels' => 2,
'fetchDescription' => true,
'descriptionCacheExpiry' => 43200, # ,
'apiThumbCacheExpiry' => 86400, #
);

$wgUploadNavigationUrl = "http://YOURFILESERVER.ru/wiki/index.php/Special:Upload"; # " " QNAP

$wgEnableUploads = true; # " "


Now you can use the second wiki (on the production server) as Wikipedia uses Wikimedia Commons — upload files to the second wiki, and use the same syntax that you use for its own files in the first. For example,
[[File:MyPic.png]]

A question for connoisseurs: how to organize a shared account for two wikis standing on different machines?

Source: https://habr.com/ru/post/116960/


All Articles