Handbuch:Ausführen von MediaWiki auf Debian oder Ubuntu

This page is a translated version of the page Manual:Running MediaWiki on Debian or Ubuntu and the translation is 62% complete.
Diese Seite zeigt Ihnen wie Sie MediaWiki unter Verwendung der Tarballs installieren. Möchten Sie Systempakete verwenden und installieren es nicht auf Raspbian siehe Debian-Pakete .

Diese Seite erklärt, wie MediaWiki auf einem Debian oder Ubuntu GNU/Linux-Server installiert werden kann. Die folgenden Anweisungen beziehen sich auf Debian, aber lassen sich auch, soweit nicht anders vermerkt, unter Ubuntu und Raspian anwenden.

Einleitung

Diese Installationsprozedur benötigt das Hintergrundwissen zur Benutzung von Befehlen per Kommandozeile in einem Terminal (z.B. Installation von Applikationen) und Texteditoren (z.B. grafisch: gedit, kate; textbasiert: nano, emacs, vi).

Falls Textbearbeitung benötigt ist kann dies auf dem grafischen Desktop getan werden indem man Alt+F2 drückt und folgendes eintippt

gksudo gedit Datei

Alternativ kann auch im Terminal bearbeitet werden

sudo nano Datei

Natürlich kann man auch kate anstatt gedit benutzen oder vi/emacs anstatt nano

Schritt für Schritt

Versichern Sie sich, dass Debian aktuell ist

Kontrollieren Sie nochmals dass Debian aktuell ist mit der Ausführung von:

sudo apt update
sudo apt upgrade

or in one line

sudo apt update && sudo apt upgrade


Installation des LAMP Stack

Ubuntu Server Edition stellt LAMP (Apache, PHP, und MySQL) während des Installationsprozesses zur Installation bereit. Stelle während des Installationsschrittes sicher, einen LAMP-Server zur Installation auszuwählen. Alternativ können alle diese Pakete auf einer Standardinstallation durch diese Befehle installiert werden:

sudo apt-get install apache2 mariadb-server php php-mysql libapache2-mod-php php-xml php-mbstring
Alternativ die Verwendung von mySQL (Raspbian Linux unterstützt kein mySQL mehr)
sudo apt-get install apache2 mysql-server php php-mysql libapache2-mod-php php-xml php-mbstring

Optional useful packages

Die Pakete sind kein Muss aber dennoch nützlich, abhänging von der Art der Installation:

Name Paket Beschreibung
Alternativer PHP-Chache php-apcu Neuere/Moderne MediaWiki Versionen ziehen den Vorteil der verbesserten Leistung daraus wenn diese Installiert sind.
PHP Unicode normalization php-intl MediaWiki will fallback to a slower PHP implementation if not available.
ImageMagick imagemagick Image thumbnailing.
Inkscape inkscape Alternative means of SVG thumbnailing, than ImageMagick. Sometimes it will render SVGs better if originally created in Inkscape.
PHP GD library php-gd Alternative to ImageMagick for image thumbnailing.
PHP command-line php-cli Ability to run PHP commands from the command line, which is useful for debugging and running maintenance scripts.
PHP cURL php-curl Benötigt von einigen Erweiterungen wie Erweiterung:Math . Siehe Manual:cURL
git source control version git If not present config script will tell you that it is not installed
Basic Calculator php-bcmath In order to make the visualeditor work on 32bit machines, like a raspi

You can install any of the above with sudo apt-get install packagename.

Wenn Sie alle davon installieren möchten:

sudo apt-get install php-apcu php-intl imagemagick inkscape php-gd php-cli php-curl php-bcmath git

If you install php-apcu you will have to reload your apache configuration in order to avoid a warning message when running configuration script:

sudo systemctl reload apache2


MediaWiki herunterladen

Dies kann man über den Browser oder über die Kommandozeile machen

cd /tmp/ wget https://releases.wikimedia.org/mediawiki/1.41/mediawiki-1.41.1.tar.gz

  • Extrahieren ins Web-Verzeichnis
tar -xvzf /tmp/mediawiki-*.tar.gz
sudo mkdir /var/lib/mediawiki
sudo mv mediawiki-*/* /var/lib/mediawiki

Konfiguration von MySQL

But before proceeding with the initial MediaWiki installation, there are certain steps you need to do first!

In Raspbian Linux, wenn es eine Erstinstallation von mariadb ist muss außerdem noch folgendes ausgeführt werden: sudo mysqld_safe --skip-grant-tables --skip-networking &

Sie müssen:

  • Erstellen eines neuen mySQL-Benutzers (new_mysql_user):
# sudo mysql -u root -p 
Passwort eingeben: Geben Sie das Passwort des mySQL-Root-Benutzers ein (wenn kein Passwort vergeben wurde ist es leer sprich einfach ENTER drücken)
mysql> CREATE USER 'new_mysql_user'@'localhost' IDENTIFIED BY 'THISpasswordSHOULDbeCHANGED';
mysql> quit;
  • Erstellen einer neuen mySQL Datenbank my_wiki:
# sudo mysql -u root -p
mysql> CREATE DATABASE my_wiki;
mysql> use my_wiki;
Database changed
  • GRANT the NEW mysql user access to the NEW created mysql database my_wiki:
mysql> GRANT ALL ON my_wiki.* TO 'new_mysql_user'@'localhost';
Query OK, 0 rows affected (0.01 sec)
mysql> commit;
mysql> quit;

Optional: PHP konfigurieren

These steps are optional and can be done post-installation. MediaWiki wird auch ohne diese Änderungen funktionieren.

Edit your PHP configuration file, php.ini . It is located at /etc/php/7.*/apache2/php.ini, depending on exact version of PHP.

Maximum upload file size

Assuming that various files are going to be uploaded to the Wiki as content, the limit on the maximum size of an upload has to be adjusted. About one-half way down is the File Uploads section. Ändere:

upload_max_filesize = 2M

zu mindestens 20M. You may have to adjust this again in the future if you want bigger uploads.

Arbeitsspeicherlimit

Manche PHP-Scripte benötigen sehr viel Arbeitsspeicher. To increase the maximum amount of memory a script can use, page down to about 21%, and change the following entry, if found, from

memory_limit = 8M

zu

memory_limit = 128M

Sollte es bereits auf 128M oder mehr stehen lassen Sie es wie es ist.

MediaWiki konfigurieren

Navigate your browser to http://localhost/mediawiki (for certain installations it may be http://localhost/mediawiki/config or http://wiki.hostname.com/config instead) and follow the procedure given.

Falls es einen 404-Fehler gibt sollte die Bearbeitung eines symbolischen Links das Problem beheben.

sudo ln -s /var/lib/mediawiki /var/www/html/mediawiki

For Debian based systems running apache2, once you create a symbolic link in the /var/www/html directory you may still run into a 404 error. If this happens, try loading: localhost/html/mediawiki/.

  • Pay close attention for "Checking environment..." in MediaWiki installation script.

This can solve a lot of problems by specifically identifying the source of any errors.

It may complain that php extensions like mbstring and xml are missing even though you have installed them. Bitte aktivieren Sie es manuell durch Verwendung von:

sudo phpenmod mbstring
sudo phpenmod xml
sudo systemctl restart apache2.service

Fill out all the fields in the configuration form and press the continue button. Nutzen Sie den Nutzernamen und das Passwort das Sie zuvor in dem "MySQL-Konfigurations"-Abschnitt vergeben haben:

mysql> CREATE USER 'new_mysql_user'@'localhost' IDENTIFIED BY 'THISpasswordSHOULDbeCHANGED';

Under Database Config, you may change the database name and DB username to new values, but you must turn on "Use superuser account", name:

debian-sys-maint

giving the mysql root password you configured earlier.

The configuration process will prompt you to download a LocalSettings.php that must be saved to the parent directory of the new wiki. The configuration page will give the exact directory/filename that must be moved:

sudo mv ~/Downloads/LocalSettings.php /var/lib/mediawiki/

And navigate your browser to http://localhost/mediawiki (or http://server_ip_address/mediawiki or http://server_ip_address/mediawiki/index.php) to see your new wiki.

Fertig! Nun haben Sie ein funktionierendes Wiki


Zusätzliche Wiki-Konfiguration

Allgemeine Informationen

MediaWiki wird in der LocalSettings.php Datei konfiguriert, normalerweise zu finden in /var/lib/mediawiki. Manual:LocalSettings.php hat detaillierte Informationen die nützlich sein können.Manual:LocalSettings.php The following are changes that appear to be universally helpful

Um die LocalSettings.php zu bearbeiten verwenden Sie

gksudo gedit /var/lib/mediawiki/LocalSettings.php

oder aus einem Terminal

sudo nano /var/lib/mediawiki/LocalSettings.php

Dateiuploads

Siehe Handbuch:Datei-Uploads konfigurieren .

Ändern des Logos

Siehe Handbuch:$wgLogos (1.35+) oder Handbuch:$wgLogo .

MediaWiki-Erweiterungen

The current tarball for MediaWiki comes with a package of 15 or so of the most popular extensions, but there are literally hundreds more.

Instructions on how to enable extensions can be found at Manual:Erweiterungen .

Pretty URLs

To use /wiki/* instead of /wiki/index.php/* on Debian, follow the recommended short URL guide using '/mediawiki' as the script path instead of '/w' and placing the rewrites in /etc/apache2/conf-enabled/mediawiki.conf.

Siehe auch