Installation von Mediawiki unter Ubuntu
Installation
Install To install on your Ubuntu server (with Apache and MySQL - ApacheMySQLPHP or another web server already installed):
sudo apt-get install mediawiki imagemagick mediawiki-math mysql-server
To enable MediaWiki edit the following file and remove the '#' from the third line so that it reads 'Alias /wiki /var/lib/mediawiki':
gksu gedit /etc/apache2/conf.d/mediawiki.conf
Then restart apache:
sudo /etc/init.d/apache2 restart
The next step is to visit the website. Since you will be entering passwords, you don't want to make an unsecured connection. Either set up a ssl server] ( see forum/server/apache2/SSL) and connect with https://your.site.net/mediawiki, or visit from the server itself (using [lynx] or [links], two excellent text-based web browsers):
lynx localhost/mediawiki
Fill out the forms, noting that the final form is NOT your root or user password, but the password for the root mysql account (blank by default)
Lastly, move the config files as requested to prevent anyone else from changing these settings:
NOTE: Check the output in your web browser if its instructions differ from below follow them.
sudo mv /var/lib/mediawiki/config/LocalSettings.php /etc/mediawiki/LocalSettings.php sudo chmod 600 /etc/mediawiki/LocalSettings.php sudo rm -Rf /var/lib/mediawiki/config
You are done! you should see a wiki page at: http://your.site.net/mediawiki
Customize
The Apache config files reside at /etc/apache2/conf.d/mediawiki.conf
You might want to customize the look of your wiki.
To change the icon make a 135x135 pixel logo in PNG format and move it to the right place:
sudo cp my_new_logo.png /var/lib/mediawiki/skins/common/images/wiki.png
To get rid of the Mac-like sunburst in the background, edit /var/lib/mediawiki/skins/monobook/main.css and change:
background: #f9f9f9 url(headbg.jpg) 0 0 no-repeat; to
background: #f9f9f9; see http://prevolution.org/mediawikifarm for running multiple wikis on a server
Dump and Restore with MySQL
An example command on how to dump the database on a Debian GNU/Linux machine using mysqldump:
root@zero:~# mysqldump --user=USERNAME --password=PASSWORD --single-transaction --all-databases > BACKUPFILE.sql
dump database named "wikidb"
root@zero:~# mysqldump -u root -psysadm wikidb > wikidb.sql
restore database named "wikidb"
root@lydia:~# mysql -u root -p -B wikidb < wikidb.sql
save all pictures
root@lydia:/var/lib/mediawiki/images# rsync -avz zero:/var/lib/mediawiki/images/*
Suchindex Wiederherstellen
im maintenance/
-Verzeichnis der MediaWiki Installation wechseln
php rebuildall.php
Quelle: http://www.mediawiki.org/wiki/Manual:Rebuildall.php
Manuelle Installation
apt-get install apache2 mysql-server php5 imagemagick php5-mysql
hier nachschauen und neueste runterladen
wget http://download.wikimedia.org/mediawiki/1.21/mediawiki-1.21.1.tar.gz
tar -xvzf mediawiki-core-1.25.2.tar.gz
Troubleshoot
Default skin aktiviren
von https://www.mediawiki.org/wiki/Skin:Vector/de
standard Vector Skin herunterladen unter skins speichern und entpacken
in der Datei LocalSettings.php
Vector eintragen
wfLoadSkin( 'Vector' );
und
$wgDefaultSkin = "vector";
auf vector setzen
Einen anderen Skin instalieren
von https://www.mediawiki.org/wiki/Category:All_skins skin laden direkt link im artikel nehmen im snapshots können Daten fehlen
skin entpacken nach /skin/NAMEDESSKINS/
in LocalSettings.php
wfLoadSkin( 'NAMEDESKIN' ); $wgDefaultSkin = "NAMEDESSKIN";
Bilder upload
in LocalSettings setzen:
$wgEnableUploads = true;
und
chown www-data images(Verzeichnis in dem mediawiki)
Update
Wenn man von 1.11 auf 1.21 updatet oder eine gedumpte bank einpflegt, kann es passieren, dass nciht alle tabellen richtig angelegt werden...
Fehler: Database returned error "1054: Unknown column 'rev_sha1' in 'field list' (localhost)"
Danach das ausführen:
mysql -u root -p mysql> ALTER TABLE /*$wgDBprefix*/revision ADD rev_sha1 varbinary(32) NOT NULL default ;
cd mediawiki/maintenance php update.php
Pfadangabe ist falsch
Einfach die Hauptseite bearbeiten und abspeichern!
Anlegen neuer Benutzer bei geschlossenem Wiki
- mit wiki admin Account anmelden
- Spezialseiten
- Anmelden/Benutzerkonto anlegen
- Neues Benutzerkonto anlegen
Plugins
Dia Plugin
Installation
- Installation Dia auf dem Mediwiki Server (z. Bsp. apt-get install dia)
- Download Dia Plugin von https://github.com/mediawiki4intranet/Dia und speichern der heruntergeladenen Dateien im Verzeichnis:
<mediawiki-verzeichnis>/extensions/Dia
- Hinzufügen folgender Zeile in der Datei LocalSettings.php
require_once("$IP/extensions/Dia/Dia.php");
- Um Dia gzippte Dateien und .svgz Dateien verarbeiten zu können muss Mediawiki gepatcht werden (NUR für Mediawiki 1.21):
cd <mediawiki-verzeichnis> patch -p1 < extensions/Dia/gzipped-xml-types-1.21.diff
Ausgabe des Patch Befehls: patching file includes/DefaultSettings.php patching file includes/MimeMagic.php patching file includes/XmlTypeCheck.php patching file includes/media/SVGMetadataExtractor.php patching file includes/mime.types
Danach können Dia Diagramme analog zu normalen Bilden hochgeladen und genutzt werden.
Probleme
FAQ: http://www.mediawiki.org/wiki/Extension:Dia#FAQ
cannot allocate memory
- Fehlermeldung:
Error creating thumbnail: dia: error while loading shared libraries: libXrender.so.1: failed to map segment from shared object: Cannot allocate memory
- Lösung: Hinzufügen folgender Zeile in der Datei LocalSettings.php
$wgMaxShellMemory = 512000;
Hochsetzen des Speichers den Mediawiki Dia zur Verfügung stellt.
Call to undefined function wfProfileIn
- bei neuern mediwiki Versionen - in aelteren Versionen gab es ein internes Profiling
- Lösung: auskommentieren der Aufrufe von wfProfileIn() und wfProfileOut()
Bestehende Accounts als Admin setzen:
- -> Spezialseiten
- -> Benutzerrechteverwaltung
- -> Benutzername eingeben (bspweise: thomas)
- -> Benutzerrechte bearbeiten -> als "Admin" (/"bot" /"Bürokrat") setzen
- -> Gruppenzugehörigkeit ändern
passwort ändern
php changePassword.php --user=target_username --password=new_password
user anlegen und als sysop promoten
cd <mediawiki-verzeichnis> php maintenance/createAndPromote.php --force --sysop USERNAME PASSWORD