MediaWiki

Prerequisites
Check the following USE flags: imagemagick math tetex vhosts |_ is actually needed to display math in MediaWiki

Installation

 * 1) emerge mediawiki
 * 2) ln -s /var/www/localhost/htdocs/mediawiki/ /var/www/schmid.dk/wiki

Configuration
start a browser and browse to http://www.sitename.dk/wiki - select to set up the Wiki

Site name              : SchmidWiki Contact e-mail         : [my email address] Sysop account name     : schmid Password / Again       : [my password] MySQL server           : servitor Database name          : wikidb DB username            : wikiuser DB password / Again    : [wikiuser password]


 * 1) mv config/LocalSettings.php.
 * 2) vim LocalSettings.php

$wgUseTeX          = true; $wgMathPath        = "{$wgUploadPath}/math"; $wgMathDirectory   = "{$wgUploadDirectory}/math"; $wgTmpDirectory    = "{$wgUploadDirectory}/tmp";


 * 1) rm -fr config

Refresh Time Hack
I hate to wait 10 seconds for refresh, when I log in, so I hacked it:


 * 1) sed -i -e "s/10;url/0;url/g" /var/www/localhost/htdocs/mediawiki/includes/OutputPage.php

Changing Style
You can change the style by altering the files of the standard monobook style: mediawiki/stylesheets/monobook/main.css <- main stylesheet mediawiki/LocalSettings.php             <- logo ($wgLogo)

Data Storage

 * All the configuration is located in LocalSettings.php, so save it if you are upgrading.
 * All text and user data is stored in the mySQL database.
 * Uploaded images are stored in the images/[character] directory

Backup
Backup all dirs but 'math' and 'tmp' from '/var/www/localhost/htdocs/mediawiki/images'. Backup LocalSettings.php.

Manually: $ mysqldump -u wikiuser -p wikidb |gzip >/tmp/wiki_backup.gz

In a script: $ mysqldump -u wikiuser -p[wikiuser password] wikidb |gzip >/tmp/wiki_backup.gz

Upgrading
If you are upgrading MediaWiki from an older version, the old database is automatically converted for the new version without any problems.

Test
And it works:
 * $$\int_{-\infty}^{\infty} e^{-x^2}\,dx = \sqrt{\pi}$$

Euler's identity:
 * $$e^{\pi i} + 1 = 0\;$$

MediaWiki - Manual Installation
The first ebuild of MediaWiki was created in November 2004, one month after schmid.wiki was started, so I first installed it "the hard way", which was actually really easy.

mySQL
First, I checked whether I had mySQL installed (never used it...)

... [ebuild  R   ] dev2004-10-18b/mysql-4.0.20-r1 |          |_ yes, it is installed.
 * 1) emerge -p mysql

Then, I added it to the default runlevel

mysql> use mysql mysql> update user set Password=PASSWORD('mypassord_here');   <- this is an ugly hack - fix it                                                                   later...
 * 1) rc-update -a mysql default                                   <- add it to the default runlevel
 * 2) /usr/bin/mysql_install_db                                    <- configuration
 * 3) rc default                                                   <- start it up
 * 4) mysqladmin -u root -h servitor password 'new_password'       <- create root user with new password
 * 5) mysqladmin -p -h servitor create wikidb
 * 6) mysql -u root -p

LaTeX Support Prerequisites

 * 1) emerge dev-lang/ocaml
 * 2) emerge imagemagick
 * 3) emerge tetex

Installation
the MediaWiki installation
 * 1) wget http://mesh.dl.sourceforge.net/sourceforge/wikipedia/mediawiki-[newest version].tar.gz
 * 2) tar -xvzf mediawiki-[newest version].tar.gz
 * 3) mv mediawiki-[newest version] /var/www/schmid.dk/wiki        <- 'wiki' is the new URL name for
 * 1) cd /var/www/schmid.dk/wiki
 * 2) chmod a+w config

texvc Bugfix and Compilation

 * 1) cd /var/www/schmid.dk/wiki/math

It seems that the syntax used for the 'convert' command in the texvc source is wrong for convert 6.1.3:


 * 1) vim render.ml

Change this: let cmd_convert finalpath = "convert -quality 100 -density 120 ps:- " ^ finalpath ^ " >/dev/null 2>/dev/null" To this: let cmd_convert finalpath = "convert -quality 100 -density 120 - " ^ finalpath ^ " >/dev/null 2>/dev/null"

And compile it:
 * 1) make

texvc Configuration
Create and set permissions for math PNG file directory 'math' and temporary directory 'tmp':
 * 1) mkdir math tmp
 * 2) chown apache:users math tmp
 * 3) chmod 744 math tmp