Help:Installing a wiki dictionary

From GRWiktionaryHelp

This page contains instructions specific to the goal of installing and configuring MediaWiki software for the purpose of hosting a Wiki dictionary.

These instructions were written prior to the release of Ultimate Wikitionary, and are regarding MediaWiki version 1.4 and with some exceptions version 1.5. We have tried to order the instructions according to the order the user would proceed in installing a Wiki dictionary for the first time.

Contents

Caching: Maximizing Your Wiki Speed

We have used Turck MMCache to speed up our Wiki response times. TurckMMCache is the most well-supported caching program available at the time of the writing of this page.

Instructions for installing Turck MMCache can be found at the Turck MMCache website. Other available caching programs which are not as well supported, but might be in future. You can find instructions for installing other caching software at Help:PHP caching and optimization.

Installation

You will need to install MediaWiki. Installation instructions can be found at Help:Installation.

  • After the web install, you can return the config settings to what they were by doing the following:
  1. cd /path/to/wiki/
  2. chmod a-w config/

Multiple Installations for Multiple Languages on the Same Server

In our installation of a Wiki dictionary we have used a multiple installation of MediaWiki. We chose the multiple installation since our dictionary will have multiple translations and we also have an installation where we imported our help pages to. Seperating the translations into different installations should make it easier to dump and maintain content specific to each language and to the help pages (to setup help pages, you will have to create a new installation as well with the database prefix 'help_' and then follow the process for importing our help pages database into that installation; see Importing/Exporting help pages below). This installation also follows the model of Wiktionary and allows us to set a language during setup which displays the MediaWiki user interface for that installation in the selected language. You might prefer an alternative setup but these instructions will cover multiple MediaWiki installation.

We followed the convention used by Wiktionary to name the different interwiki links of the different installations using the two letter ISO country codes. We also used this naming convention for the install directories of the wikis.

Instructions for installing multiple MediaWikis to support multiple languages can be found at Help:Installing more than one wiki on one server.

InterWiki Linking: Linking Between Your Different Wiki Language Installations

If you are installing multiple instances of MediaWiki for a multiple language setup, you will also need to setup Interwiki linking. This will let users make simple links between the different installations using wikitext and the language ISO code. For each installation we had to setup interwiki links to each of the other installations. Our help pages also require they're

Instructions for setting up interwiki linking can be found at Help:Interwiki links.

Configuring To Allow Users To Stay Logged In Across Different MediaWiki Installations

Importing and Exporting Help Pages

Once you have setup your installations, including an installation for the help pages, you can import the help pages from a database export. You will have setup an installation to hold the help pages in the section above: Multiple Installations for Multiple Languages on the Same Server. After your installation has been active for a while and changes have been made to your help pages, you might want to export them in the instance that you are modifying or moving your installation.

Instruction for importing and exporting help pages can be found at Help:Importing and Exporting Help Pages.

Security precautions

Securing your Wiki from intruders is a necessity. To secure your Wiki follow the recommendations listed at Help:Security.

Setup Email Notification

When users setup watches on certain wiki pages, we would like automated emails sent to them every time changes were made to that page. For this we need the feature known as email notification.

Newer versions of MediaWiki have email notification integrated into the installation. You won't need to install anything extra, only to configure it. Versions of MediaWiki previous to 1.5 don't have it and to install it you will be required download the package, then install it and configure it.

You can find instructions for installing and configuring email notification at m:Help:Email notification and update marker.

Installing Document Export Support

We have implemented a special page that will allow users to export pages from the wiki into HTML, PDF, and XML.

The instructions for installing the document export functionality are at Help:Installing Document Export Support.

The location of the files referenced in those instructions can be found at Help:Wiki Dictionary Installation Files.

Instructions on using the Document Export can be found at Help:Document export.

Installing The Automatic Keyword Linking Function

We have implemented a special page that will automatically look for keywords in each of your wiki pages and create links to the relevant wiki pages. However it is only designed to work when your wiki pages do not yet have any links to other wiki pages. The function should only be used once immediately after you have populated the wiki with your content which was done immediately after a fresh install of the wiki without any further configuration. That content should not contain any wiki links when you execute the function. You will have to make sure that users are not accessing the wiki while you execute this function.

There are some variables you can change to modify functioning of the scan. The scan is set to start at the first created page on a newly installed wiki. You might want to change it. You can change the variable $wgStartTitle to do so. You can login to the wiki database on MySQL and find which id numbers go with which wiki pages so you can decide what you would like to set it to.

If there are many pages in your wiki the scan can slow and halt since it requires a lot of processing power. You can slow processing by decreasing the value of $wgTitlesPerRun which determines the number of wiki pages processed per run of the scan.

You can use the instructions for installing special pages to install the Automatic Keyword Linking Function. They are at Help:Installing extensions and special pages. The location of the files referenced in those instructions can be found at Help:Wiki Dictionary Installation Files

Further help on using the keyword linking function can be found at Help:Keyword linking scan.

How To Change Contents of Navigation Toolbar

We changed our navigation toolbar that appears on the top left margin of the Wiki. We added a link to our help pages. Instructions for adding a link to your navigation toolbar can be found at Help:How To Change Contents of Navigation Toolbar.

In our case, we have the following array defined in our LocalSettings.php file:

$wgNavigationLinks = array (
       array( 'text'=>'mainpage',      'href'=>'mainpage' ),
       array( 'text'=>'portal',        'href'=>'portal-url' ),
       array( 'text'=>'currentevents', 'href'=>'currentevents-url' ),
       array( 'text'=>'recentchanges', 'href'=>'recentchanges-url' ),
       array( 'text'=>'randompage',    'href'=>'randompage-url' ),
       array( 'text'=>'help',          'href'=>'helppage' ),
       array( 'text'=>'sitesupport',   'href'=>'sitesupport-url' ),
       array( 'text'=>'documentexport',   'href'=>'documentexport-url' ),
);

The last defining the link to the document export special page. Then we could define the name of the link by logging in as the admin of our wiki and loading the page:

http://xx.xx.xx.xx/en/index.php/MediaWiki:Documentexport

and editing it to display the name we choose. We set the url of the link by loading the page:

http://xx.xx.xx.xx/en/index.php/MediaWiki:Documentexport-url

And entering the url of our link. In our case that url was:

http://xx.xx.xx.xx/en/index.php/Special:DocumentExport

Setting Up Create Page Option For When A Search Fails

When a user searches a term and nothing is returned, by default there is not option to create a page with the inputted term. We can configure so that the option is presented upon an empty search return.

Instructions for doing this can be found at Help:Setting up create page option for when a search fails.

Setting The Copyright For Your Wiki

You might want to append your copyright to your Wiki pages.

Instruction to insert your copyright can be found at Help:Setting the copyright for your wiki.

Changing the Wiki Logo

We changed the default MediaWiki logo that appears at the top left margin, to our own logo.

Instructions for changining the logo can be found at Help:Changing the Wiki Logo

Configure To Allow Image Uploads

To allow users to upload images to your wiki you will have to modify the file LocalSettings.php located in the main MediaWiki install directory. It contains the local configuration of a MediaWiki. Changing a setting usually means changing the value of a PHP variable. You might want to make yourself familiar with the PHP syntax first before going ahead. If you are too lazy, keep in mind that PHP variables are accessed by prepending a "$" character before the variable name; many variables are simply set to either true or false. It is located in the main MediaWiki install directory.

Before users are allowed to upload files to the MediaWiki system, you have to enable that feature. Make sure the Upload Directory is properly configured and writeable by the Apache web server process. It's ownership should be by the webserver and we had to use the chmod command to make it writeable by group and other with the commands:

chmod g+w images
chmod o+w images

Then set the wgDisableUploads to false to allow uploading in the web user interface (it is likely the case that the line is already there but just commented out with a prepended '#', so you can uncomment it by removing the '#'). The 'Upload file' link will appear to users in the toolbox menu in the left margin of your wiki when they are logged in as valid users.

If you want to be able to resize images on the fly to support thumbnails, MediaWiki needs a working ImageMagick installation. Set the variable $wgUseImageMagick to true once you have installed and tested ImageMagick on your system. Make sure the wgImageMagickConvertCommand variable points to the proper location of the convert command of your installation and that the command is executable by the web server process.

Also, you may want to modify the list of accepted extensions:

$wgFileExtensions = array( 'png', 'jpg', 'jpeg', 'ogg','doc','xls','ppt','mp3','sxc','pdf' );

Backup Your Wiki

Instructions for manually backing up and restoring your wiki contents can be found at Help:Backup database.

We implemented an automated Wiki backup script. A description of the script and instructions for installing it can be found at Help:Automated wiki backup.

The location of the script is listed in Help:Wiki Dictionary Installation Files.

Upgrading MediaWiki

For security reasons it is important to keep your MediaWiki up to date with the latest release.

You should backup your wiki before you make any serious upgrades (i.e. dump the contents of your current database for safety). You can find instructions on backing up your wiki at Help:Backup database.

You can find upgrade instructions at Help:Upgrading MediaWiki. However, read the following tips before you start:

Generally when upgrading you should consider the following instructions:

  • Check what version of MediaWiki you are running.
    • This will be located at the top of includes/DefaultSettings.php of your MediaWiki install directory.
  • Download latest version of MediaWiki at http://wikipedia.sourceforge.net/
  • First read the UPGRADE readme in the package you downloaded to see what sort of upgrade to use: script or web-based.
  • In the case of the web-based upgrade: You will have to unpack the downloaded upgraded MediaWiki directly into the current Wiki directory for upgrade.
    • One way to do this is to rename the wiki directory to the directory that MediaWiki will automatically unpack to (usually the text of the package name up to but not including .tar.gz), and then unpack the file in directory just above that of the installed wiki.
  • Then start the web-based upgrade (you will need information you used in the original installation: database access info (wiki user, pw), the wiki name, wiki admin name and password).
    • If you have backed up your configuration files, you should be able to find some of these in the LocalSettings.php file.
  • The script should allow you to upgrade directly from the command line and should be the case for newer versions of MediaWiki.
  • Open the package and read the file labeled UPGRADE. It will contain specific instructions on how to upgrade.
  • You should check if there are upgrades to the HTML2PDF conversion tool if you have installed it.

Keeping Up To Date

Check the MediaWiki homepage for other mailing lists.