Mediawiki installation: Difference between revisions

The educational technology and digital learning wiki
Jump to navigation Jump to search
Line 54: Line 54:
=== Messages ===
=== Messages ===


; Interface 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).
# List all messages with Special:Allmessages
# List all messages with the special page '''Special:Allmessages'''
# You then can customize each message, by clicking on a message and edit
# You then can customize each Mediawiki message, by clicking on a message and edit


Notice:
Notice:
* Works by default, i.e. $wgUseDatabaseMessages = true;
* 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
* 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
; 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.
* 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)
; Sitenotices (e.g. to annonce an important event)
Read: http://www.mediawiki.org/wiki/Manual:Interface/Sitenotice
Read: http://www.mediawiki.org/wiki/Manual:Interface/Sitenotice


The simplest way of using it:
Another way way of using it is to define $wgSiteNotice = " ........ "; in LocalSettings.php
<pre>
$wgSiteNotice = " ........ ";
</pre>
 


=== Nice URLs ===
=== Nice URLs ===
Line 173: Line 171:
== Extensions ==
== 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]].
* Put in the extensions folder of your installation
* Add all the extra stuff an extension may need (sometimes a lot (!) sometimes nothing)
* Load the extension in LocalSettings.php
=== Collection ===
There exist two ways of using this PDF/OO/DocBook book generator. Just install the extension files and use the PediaPress server. This did not work out well and we use our own server. Installation is fairly complex:
See [[Mediawiki collection extension installation]] for details.
Software needed (at least)
* Perl => 5
* g++
* Latex
** Also compile texvc in mediawiki/math directory
* Blahtexml
* Python => 2.5
** Python setuptools http://pypi.python.org/pypi/setuptools
** python imaging library (PIL) http://www.pythonware.com/products/pil/
** odfpy 0.7.0 http://odfpy.forge.osor.eu/
* rec2c
** http://re2c.org/
* ocaml
** http://caml.inria.fr/
* Pygments
** http://pygments.org/
* Fribidi - both a library and the Python bindings
** http://pyfribidi.sourceforge.net/index.html
* Mwlib
** http://code.pediapress.com/hg/mwlib/
* mwlib.rl
** http://www.mediawiki.org/wiki/Extension:PDF_Writer





Revision as of 17:00, 12 August 2009

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.
  • Put in the extensions folder of your installation
  • Add all the extra stuff an extension may need (sometimes a lot (!) sometimes nothing)
  • Load the extension in LocalSettings.php

Collection

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

See Mediawiki collection extension installation for details.

Software needed (at least)

  • Perl => 5
  • g++
  • Latex
    • Also compile texvc in mediawiki/math directory
  • Blahtexml