Mediawiki installation

The educational technology and digital learning wiki
Jump to navigation Jump to search

This article or section is currently under construction

In principle, someone is working on it and there should be a better version in a not so distant future.
If you want to modify this page, please discuss it with the person working on it (see the "history")

I will describe here installation procedure of EduTechWiki and its major extensions. Got a brand new server :) - Daniel K. Schneider 11:59, 12 August 2009 (UTC)

Installation tips are for Ubuntu. The old version runs under Solaris (IMHO a superior but much more difficult environment, this is why we decided to switch).

First time installation

I will make this short, since it's not difficult...


Configuration

The main configuration file

Unless you use some configuration extension, all the configuration (except for styles and user messages) is done in file LocalSettings.php (in the top-level directory of the distribution)

Reading: http://www.mediawiki.org/wiki/Manual:Configuration_settings

LocalSettings.php will read first the file includes/DefaultSettings.php and then override with your own settings. Below are a few settings (also read "nice URLs" below).

// also used as namespace for certain pages, so select with care
$wgSitename   = "EduTech Wiki";
 
// Use the file cache
$wgUseFileCache = true;
$wgFileCacheDirectory = "$IP/cache";
$wgShowIPinHeader = false; 

// Rights
$wgEnableCreativeCommonsRdf = true;
$wgRightsPage = "EduTech_Wiki:Copyrights"; # Set to the title of a wiki page that describes your license/copyright
$wgRightsUrl = "http://creativecommons.org/licenses/by-nc-sa/3.0/";
$wgRightsText = "CC BY-NC-SA Licence";
$wgRightsIcon = "$wgStylePath/monobook/tecfa/somerights.png";

// Permissions - editing users need to have a login
$wgGroupPermissions['*']['edit']            = false;
$wgGroupPermissions['*']['createaccount']   = true;
# $wgGroupPermissions['*']['createaccount']   = false;
$wgGroupPermissions['*']['read']            = true;

// Strongly suggest to keep this (enabled by default). Puts all the messages in the database // (easier to edit and edits will survive upgrades $wgUseDatabaseMessages = true;

// What file uploads to you accept, e.g. $wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'ogg', 'pdf', 'mp3', 'svg', 'doc', 'xls', 'ppt', 'pub', 'txt', 'ps', 'zip' );

Messages

Configuring interface messages is quite easy. Use the following procedure, if you can't recall the names of the appropriate Mediawiki pages (each message is defined in its own page).

  1. List all messages with the special page Special:Allmessages
  2. You then can customize each Mediawiki message, by clicking on a message and edit

Notice:

  • Works by default, i.e. $wgUseDatabaseMessages = true;
  • If you are not using database messages, you can edit the languages/Language.php file (for English) or languages/LanguageXX.php for non-English languages, where XX is the two-letter language code for your language
  • Be careful: entering wrong data may disable some messages ....

Each of the Mediawiki:XXX pages you may configure are listed in Special:Allmessages as we said above. The ones you did redefine will be in green. Below are two examples:

A slogan message

The page MediaWiki:Sitesubtitle will allow you to add some sort of slogan (you also can kill this default page). Has the same effect as setting the $wgExtraSubtitle variable.

Sitenotices (e.g. to annonce an important event)

Read: http://www.mediawiki.org/wiki/Manual:Interface/Sitenotice

Another way way of using it is to define $wgSiteNotice = " ........ "; in LocalSettings.php

Nice URLs

You don't want ugly default URLs (e.g. http://edutechwiki.unige.ch/en/Mediawiki_installation instead of http://edutechwiki.unige.ch/mediawiki/index.php?title=Mediawiki_installation).

Reading: http://www.mediawiki.org/wiki/Manual:Short_URL

Here is an easy way to do achieve this for the content pages. The method described below is probably not exactly the one that is now being suggested by the manual, but we have to stick to our old solution since we believe in stable URLS !

In httpd.conf:

  Redirect /portails/mediawiki  "http://edutechwiki.unige.ch/en"
  Redirect /mediawiki  "http://edutechwiki.unige.ch/en"
  Redirect /portails/fmediawiki "http://edutechwiki.unige.ch/fr"

<VirtualHost *:80>
       ServerName edutechwiki.unige.ch
       DocumentRoot "/data/portails/edutechwiki"
   # ALIASES for edutechwiki: THREE alias for each WIKI
   Alias /mediawiki "/data/portails/mediawiki"
   Alias /en "/data/portails/mediawiki/index.php"
   Alias /en/index.php "/data/portails/mediawiki/index.php"
   Alias /fmediawiki "/data/portails/fmediawiki"
   Alias /fr "/data/portails/fmediawiki/index.php"
   Alias /fr/index.php "/data/portails/fmediawiki/index.php"
< /VirtualHost >	

Then in LocalSettings.php:

$wgSitename         = "EduTech Wiki";
$wgScriptPath	    = "/mediawiki";
$wgScript           = "$wgScriptPath/index.php";
$wgRedirectScript   = "$wgScriptPath/redirect.php";
## If using PHP as a CGI module, use the ugly URLs
#   $wgArticlePath      = "$wgScript/$1";
# DKS 3/2006
$wgArticlePath      = "/en/$1";

Therefore only "normal" pages look nice. Special pages remain ugly, but this doesn't matter IMHO.

Also consider excluding all or most special pages in robots.txt. No reason that these should be indexed and they really eat away CPU cycles if you need another argument.

User-agent: *
Disallow: /mediawiki/
Disallow: /en/Special:Search
Disallow: /en/Special:Random

etc ....

Skins and CSS

Unless you have time to spend, I suggest to use the standard Monobook skin. Other skins are not as well supported. E.g. some extensions just won't work with other skins.

You should define CSS (in particular class or id selectors for extensions) in MediaWiki:Common.css. Do not edit CSS files in the server if you can avoid. This strategy makes maintenance much easier.

Changes to the navigation bar to the left

Reading: Navigation bar help

Configuration: Edit MediaWiki:Sidebar in your wiki

Since version 1.14 (or earlier) you may use keywords to change the order of portlets (boxes with menu items). E.g.

* SEARCH

* navigation and help
** mainpage|Mainpage
** EduTech_Wiki:About|about
<!-- ** portal-url|portal -->
<!-- ** currentevents-url|currentevents --> 
** randompage-url|randompage
** helppage|Help
** Help:Editing rules|Editing rules
** Blog:DKS|Blog (D.K.S.)

* categorytree-portlet

* TOOLBOX

* LANGUAGES

* big brother
** Special:Newpages|New Pages
** recentchanges-url|recentchanges
** Special:Guestbook|Guestbook
** Special:Popularpages|Popular Pages
** Special:WhosOnline|Who is online ?

* TECFA links
** http://tecfa.unige.ch/ |TECFA
** http://tecfaseed.unige.ch/door/ |TECFA Portal

In addition one also could add more sophisticated custom items (instead of hand editing the skin files, to do ....)

Extensions

See also the Mediawiki where we list extensions we find useful to have. Here, we only document the more difficult ones.

General installation principle

  • Check if the extension is compatible with your MW version (this is not always obvious, therefore you also should look for hints in its dicussion page).
  • Read the discussion page that will tell you something about its quality.
  • Download the extension either as archive (zip etc.) or via subversion. Make sure that the files sit in a directory unless its a simple single file extension
  • Put the extension directory in the extensions folder of your installation
  • Add all the extra stuff an extension may need (sometimes a lot (!), sometimes nothing). Most extensions are simple and don't need other server-side programs
  • If the extension needs a cache, you will have to change write permissions
  • Edit LocalSettings.php to load the extensions. You also may have to define configuration options.

Collection

There exist two ways of using this PDF/OO/DocBook book generator. Just install the extension files and use the PediaPress server for generating the PDF or OO documents. This strategy did not work out well and we use our own server. Installation is fairly complex.

Most important documentation and download pages
Extension page Collection: http://www.mediawiki.org/wiki/Extension:Collection
Extension page PDF_Writer: http://www.mediawiki.org/wiki/Extension:PDF_Writer
MwLib/Collection server installation guide (if needed): http://code.pediapress.com/wiki/wiki/mwlib-install
See Mediawiki collection extension installation for our own installation notes

Additional software needed if you install your own MwLib (at least)

Dependencies
  • Perl => 5
  • g++
  • Latex
    • Also compile texvc in mediawiki/math directory
  • Blahtexml
The mwlib server and tools

Graphviz

Most important documentation and download pages
Extension page: http://www.mediawiki.org/wiki/Extension:GraphViz
Additional installs: Graphviz from http://www.graphviz.org/Download.php plus needed libraries that you may or may not have on your server
Dependencies

Graphviz itself needs several libraries like GD, Zlib, Freetype, PNG, JPEG, EXPAT, etc. (read http://www.graphviz.org/Download_source.php Requirements).

There exist binary packages for most systems (not yet tested)

Tag cloud

Extension page: http://www.mediawiki.org/wiki/Extension:WikiCategoryTagCloud

Extension page (old): http://wiki-tools.com/wiki/Wiki_Category_Tag_Cloud

Additional installs: None

Hints:

  • If you want an accurate cloud, you should edit MediaWiki:Tagcloudpages and add the pages to invalidate the cache for.

UML

Most important documentation and download pages
Extension page: http://www.mediawiki.org/wiki/Extension:UML

This extension dates back to 2007, but still seems to work

Additional installs
MetaUML from http://metauml.sourceforge.net/
Dependencies
ImageMagick and Ghostscript