MediaWiki
From ICELabWiki
MediaWiki is the wiki software we use. In fact you're using it right now!
Contents |
[edit] Installation/Setup
Pretty easy to set up. Prereq: you need a typical LAMP installation. Virtually all basic setup is done with PHP so just navigate (with a web browser) to the directory where MediaWiki is installed and go from there.
[edit] File Upload
To enable file upload, turn the setting ($wgEnableUploads) on in LocalSettings.php and make sure that the images directory can be written to by the user that apache runs as (www-data in this case) If you want thumbnailing, install imagemagick (it's in synaptic/apt-get), enable it in LocalSettings, and set the path appropriately.
We also use the UploadLocal extension to do mass uploads of files on the local server to the wiki. (It's more of a database-add than an upload I suppose) Get it here: http://meta.wikimedia.org/wiki/SpecialUploadLocal (metawiki is broken?) When the script runs, it seems to give a chmod-type error for each file that's uploaded but it apparently works fine.
[edit] Antivirus
And since we're dealing with files from/to Windows clients, we need antivirus. We're using clamav - when setting it up, install it from source rather than Synaptic since the Ubuntu repository one is out of date. Before installing, you have to set up a user and group for it. There are some pretty self-explanatory ./configure options (where to put it, etc.) and the virus database should be updated regularly (freshclam is the program that updates it - add it to cron.daily, or crontab, or cron something). The documentation for it is pretty easy to find & read and includes most of this stuff.
After clamav is set up, I had to tell MediaWiki to use it by adding this to LocalSettings:
$wgAntivirus = 'clamav';
$wgAntivirusRequired = true;
$wgAntivirusSetup = array(
#setup for clamav
'clamav' => array (
'command' => "clamscan --no-summary ",
'codemap'=> array (
"0"=> AV_NO_VIRUS, #no virus
"1"=> AV_VIRUS_FOUND, #virus found
"52"=> AV_SCAN_ABORTED, #unsupported file format (probably immune)
"*"=> AV_SCAN_FAILED, #else scan failed
),
'messagepattern'=> '/.*?:(.*)/sim',
),
);
[edit] Backup & Restore
Backup of the MySQL database is done through the wiki-database-backup ruby script, which we do daily by putting that script into /etc/cron.daily (note: files in there can't have . in them, so no extensions) The script does a mysql databas 19a0 e dump (with mysqldump), compares it to yesterday's, and tars and mails it if there is a change. The somewhat broken part about that is that there's an objectcache table in the database, and that presumably changes whenever someone looks at the wiki. Note to self: check if the wiki was read last weekend.
For restoring, just direct the database backup file into the mysql shell. Something like:
mysql -u user -ppassword database < backup
Or you can just leave out the password part after the p (and then enter it securely when the command runs) if you don't want the password displayed in plain text in the terminal.

