Aktuelle Version |
Dein Text |
Zeile 1: |
Zeile 1: |
| {{Achtung|
| | #WEITERLEITUNG [[Server/Wiki#MediaWiki]] |
| Dieser Artikel ist ein exemplarischer Artikel.
| |
| | |
| Es handelt sich hierbei nicht um die Instanz [[MediaWiki]] als Wiki vom StuRa.
| |
| Dazu dienen die Artikel:
| |
| * [[Wiki]];
| |
| * [[Server/srs13]].
| |
| }}
| |
| | |
| == Installation ==
| |
| | |
| === Randbedingungen ===
| |
| | |
| ; OS: [[FreeBSD]][https://www.freebsd.org/releases/10.1R/readme.html 10.1]
| |
| :; Paketverwaltung: [[freebsd-man:pkgng]] (statt [[freebsd-man:make]])
| |
| | |
| === tatsächliche Installation ===
| |
| | |
| Initialisieren von pkgng
| |
| : <code>pkg</code>
| |
| | |
| Installieren von MediWiki
| |
| * Leider muss eine bestimmte Version zur Installation angegeben werden.
| |
| ** Welche Versionen zur Installation zur Verfügung stehen, kann durch eine Suche nach verfügbaren Paketen zu ''mediawiki'' herausgefunden werden.
| |
| **: <code>pkg search mediawiki</code>
| |
| : <code>pkg install mediawiki124</code>
| |
| <!--
| |
| <pre>
| |
| Message for mediawiki124-1.24.0:
| |
| **** NOTE ****
| |
| Remember to check
| |
| | |
| %25%25MEDIAWIKIDIR%25%25/INSTALL
| |
| | |
| and
| |
| | |
| %25%25MEDIAWIKIDIR%25%25/UPGRADE
| |
| | |
| for details
| |
| </pre>
| |
| -->
| |
| | |
| Installation eines Datenbankservers
| |
| * MediaWiki unterstützt eine Vielzahl von Datenbanken (z. B. SQLite, PostgreSQL oder MariaDB). MySQL ist die übliche Vorauswahl, so auch bei [[FreeBSD]].
| |
| : <code>pkg install mysql55-server</code>
| |
| <!--
| |
| <pre>
| |
| Message for mysql55-server-5.5.41:
| |
| ************************************************************************
| |
| | |
| Remember to run mysql_upgrade the first time you start the MySQL server
| |
| after an upgrade from an earlier version.
| |
| | |
| ************************************************************************
| |
| </pre>
| |
| -->
| |
| Starten von MySQL als Server für die Datenbank
| |
| : <code>/usr/local/etc/rc.d/mysql-server onestart</code>
| |
| Obligatorisches Aktualisieren von MySQL zum Prüfen der Funktionsfähigkeit durch sich selbst
| |
| : <code>/usr/local/bin/mysql_upgrade</code>
| |
| Eintragung in die Datei zur Konfiguration der Umgebung des System, dass MySQL nach einem mögliche Neustart laufen soll
| |
| : <code>echo 'mysql_enable="yes"' >> /etc/rc.conf</code>
| |
| | |
| Installation eines Webservers
| |
| * MediaWiki kann durch eine Vielzahl von Web-Diensten (z. B. nginx) ausgeliefert. Apache ist die übliche Vorauswahl, so auch bei [[FreeBSD]].
| |
| : <code>pkg install apache24</code>
| |
| <!--
| |
| <pre>
| |
| Message for apache24-2.4.10_2:
| |
| To run apache www server from startup, add apache24_enable="yes"
| |
| in your /etc/rc.conf. Extra options can be found in startup script.
| |
| | |
| Your hostname must be resolvable using at least 1 mechanism in
| |
| /etc/nsswitch.conf typically DNS or /etc/hosts or apache might
| |
| have issues starting depending on the modules you are using.
| |
| </pre>
| |
| -->
| |
| Eintragung in die Datei zur Konfiguration der Umgebung des System, dass Apache (2.4) nach einem mögliche Neustart laufen soll
| |
| : <code>echo 'apache24_enable="yes"' >> /etc/rc.conf</code>
| |
| | |
| Installieren des Moduls zur Verwendung von PHP für Web-Dienste
| |
| : <code>pkg install mod_php56</code>
| |
| <!--
| |
| <pre>
| |
| perl: warning: Setting locale failed.
| |
| perl: warning: Please check that your locale settings:
| |
| LC_ALL = "de.UTF-8",
| |
| LANG = "de.UTF-8"
| |
| are supported and installed on your system.
| |
| perl: warning: Falling back to the standard locale ("C").
| |
| [activating module `php5' in /usr/local/etc/apache24/httpd.conf]
| |
| Message for mod_php5-5.4.35,1:
| |
| ***************************************************************
| |
| | |
| Make sure index.php is part of your DirectoryIndex.
| |
| | |
| You should add the following to your Apache configuration file:
| |
| | |
| <FilesMatch "\.php$">
| |
| SetHandler application/x-httpd-php
| |
| </FilesMatch>
| |
| <FilesMatch "\.phps$">
| |
| SetHandler application/x-httpd-php-source
| |
| </FilesMatch>
| |
| | |
| ***************************************************************
| |
| </pre>
| |
| -->
| |
| : Eintragung des gewünschten Umgangs von Anwendungen mit Dateien der Endung ''php''
| |
| :: <code>echo '<FilesMatch "\.php$">' >> /usr/local/etc/apache24/httpd.conf</code>
| |
| :: <code>echo 'SetHandler application/x-httpd-php' >> /usr/local/etc/apache24/httpd.conf</code>
| |
| :: <code>echo '</FilesMatch>' >> /usr/local/etc/apache24/httpd.conf</code>
| |
| :: <code>echo '<FilesMatch "\.phps$">' >> /usr/local/etc/apache24/httpd.conf</code>
| |
| :: <code>echo 'SetHandler application/x-httpd-php-source' >> /usr/local/etc/apache24/httpd.conf</code>
| |
| :: <code>echo '</FilesMatch>' >> /usr/local/etc/apache24/httpd.conf</code>
| |
| : oder
| |
| :: <code>$EDITOR /usr/local/etc/apache24/httpd.conf</code>
| |
| <pre>
| |
| <FilesMatch "\.php$">
| |
| SetHandler application/x-httpd-php
| |
| </FilesMatch>
| |
| <FilesMatch "\.phps$">
| |
| SetHandler application/x-httpd-php-source
| |
| </FilesMatch>
| |
| </pre>
| |
| | |
| Erzeugen eines Accounts für die Datenbank MySQL und das Setzen des dazugehörigen Passwortes
| |
| : <code>/usr/local/bin/mysqladmin --user=name-of-the-user-in-mysql password "password-of-the-user-in-mysql"</code>
| |
| <!--
| |
| : <code>mysqladmin -u root password password</code>
| |
| -->
| |
| | |
| Anpassen der Datei für die Konfiguration vom Webserver Apache (2.4)
| |
| * Abschaltung des allgemeinen globalen Verbietes des Zugriffs
| |
| *: <code>$EDITOR /usr/local/etc/apache24/httpd.conf</code>
| |
| <pre>
| |
| #<Directory />
| |
| # AllowOverride none | |
| # Require all denied
| |
| #</Directory>
| |
| </pre>
| |
| * Ändern des zentralen Verzeichnisses wo sich die Daten befinden, die als Webdienst ausgeliefert werden sollen
| |
| *: <code>$EDITOR /usr/local/etc/apache24/httpd.conf</code>
| |
| <pre>
| |
| #DocumentRoot "/usr/local/www/apache24/data"
| |
| DocumentRoot "/usr/local/www/mediawiki"
| |
| </pre>
| |
| * Ergänzen des Einbeziehens vom Verzeichnis wo MediaWiki beheimatet ist
| |
| *:: <code>echo '<Directory "/usr/local/www/mediawiki">' >> /usr/local/etc/apache24/httpd.conf</code>
| |
| *:: <code>echo 'Options Indexes FollowSymLinks' >> /usr/local/etc/apache24/httpd.conf</code>
| |
| *:: <code>echo 'DirectoryIndex index.php index.html' >> /usr/local/etc/apache24/httpd.conf</code>
| |
| *:: <code>echo 'AllowOverride None' >> /usr/local/etc/apache24/httpd.conf</code>
| |
| *:: <code>echo 'Order allow,deny' >> /usr/local/etc/apache24/httpd.conf</code>
| |
| *:: <code>echo 'Allow from all' >> /usr/local/etc/apache24/httpd.conf</code>
| |
| *:: <code>echo '</Directory>' >> /usr/local/etc/apache24/httpd.conf</code>
| |
| *: oder
| |
| *:: <code>$EDITOR /usr/local/etc/apache24/httpd.conf</code>
| |
| <pre>
| |
| <Directory "/usr/local/www/mediawiki">
| |
| Options Indexes FollowSymLinks
| |
| DirectoryIndex index.php index.html
| |
| AllowOverride None
| |
| Order allow,deny
| |
| Allow from all
| |
| </Directory>
| |
| </pre>
| |
| | |
| Starten des Webservers Apache
| |
| : <code>/usr/local/sbin/apachectl restart</code>
| |
| | |
| Prüfen des erfolgreichen Auslieferns des Web-Dienstes
| |
| : http://localhost
| |
| | |
| * Beginn der restlichen Installation über das web user interface
| |
| | |
| Bei einer Prüfung der Funktionalitäten bei der restlichen Installation über das web user interface weist MediaWiki auf Dienste hin, die es gern nutzen möchte, jedoch bisher nicht installiert sind.
| |
| : Installieren der Versionsverwaltung git
| |
| :: <code>pkg install git</code>
| |
| : Installieren von einer Ergänzung zu Sprachen für PHP
| |
| :: <code>pkg install pecl-intl</code>
| |
| : Installieren von einer Ergänzung zur Verarbeitung von Bildern für PHP
| |
| :: <code>pkg install pecl-imagick</code>
| |
| : Installieren von einer Ergänzung zum Nutzen eines Cache für PHP
| |
| :: <code>pkg install pecl-APC</code>
| |
| | |
| Auch wird geprüft, wie der Web-Dienst ausgeliefert wird.
| |
| : Anpassung der administrativen Mail-Adresse für den Webserver Apache (2.4)
| |
| :: <code>$EDITOR /usr/local/etc/apache24/httpd.conf</code>
| |
| <pre>
| |
| #ServerAdmin you@example.com
| |
| ServerAdmin mediawiki@stura.htw-dresden.de
| |
| </pre>
| |
| : Eintragung des Namens des Servers, der die Domain, im Zweifelsfall (etwa mangels DNS) eine IP-Adresse, ist und den Port für den Webserver Apache (2.4) angibt
| |
| :: <code>$EDITOR /usr/local/etc/apache24/httpd.conf</code>
| |
| <pre>
| |
| ServerName 141.56.50.13:80
| |
| </pre>
| |
| | |
| Der Sicherheit wegen, sollten Inhalte das Uploadverzeichnisses (normalerweise Bilder etc.) nicht ausführbar sein
| |
| : Dies kann per Apache-Konfig oder .htaccess-Datei im entspr. Verzeichnis erreicht werden. Hier ein Beispiel für die Apache-Konfig:
| |
| | |
| :: <code>$EDITOR /usr/local/etc/apache24/httpd.conf</code>
| |
| <pre>
| |
| <Directory "/Library/MediaWiki/web/images">
| |
| # Ignore .htaccess files
| |
| AllowOverride None
| |
|
| |
| # Serve HTML as plaintext, don't execute SHTML
| |
| AddType text/plain .html .htm .shtml .php .phtml .php5
| |
|
| |
| # Don't run arbitrary PHP code.
| |
| php_admin_flag engine off
| |
|
| |
| # If you've other scripting languages, disable them too.
| |
| </Directory>
| |
| </pre>
| |
| | |
| erneutes Starten des Webservers Apache
| |
| : <code>/usr/local/sbin/apachectl restart</code>
| |
| | |
| Durchführung der restlichen Installation über das web user interface
| |
| <!--
| |
| http://localhost/mw-config/index.php?page=DBConnect
| |
| : Datenbankserver:
| |
| :: ''localhost''
| |
| : Bitte Daten zur eindeutigen Identifikation dieses Wikis angeben
| |
| :: Datenbankname:
| |
| ::* Der ''Datenbankname'' kann selbst bestimmt werden bestimmt.
| |
| ::: mediawiki
| |
| : Benutzerkonto für die Installation
| |
| :: Name des Datenbankbenutzers:
| |
| ::: von mysqladmin
| |
| ::: ''name-of-the-user-in-mysql''
| |
| :: Passwort des Datenbankbenutzers:
| |
| ::: password-of-the-user-in-mysql
| |
| http://localhost/mw-config/index.php?page=DBSettings
| |
| : Dasselbe Datenbankkonto wie während des Installationsvorgangs verwenden
| |
| :: abgewählt
| |
| : Datenbankkonto für den Webzugriff
| |
| :: Name des Datenbankbenutzers:
| |
| ::: ''name-of-the-user-for-mediawiki-in-mysql''
| |
| :: Passwort des Datenbankbenutzers:
| |
| ::: ''password-of-the-user-for-mediawiki-in-mysql''
| |
| : Benutzerkonto für die Installation
| |
| :: angewählt
| |
| <pre>
| |
| Fatal error: Call to undefined function hash() in /usr/local/www/mediawiki/includes/password/Pbkdf2Password.php on line 59
| |
| </pre>
| |
| -->
| |
| | |
| Eintragen der nach dem Abschluss der restlichen Installation über das web user interface erstellten Datei LocalSettings.php
| |
| : <code>$EDITOR /usr/local/www/mediawiki/LocalSettings.php</code>
| |
| | |
| : Datenbankeinrichtung (MySQL)
| |
| :: Aus Sicherheitsgründen scheint es mir sinnvoll, als Datenbanknutzer nicht root sondern einen extra User zu verwenden.
| |
| | |
| ::Folgendes legt einen User samt gleichnamiger Datenbank ''mediawiki'' an und gewährt ihm sämtliche Rechte (auf diese eine Datenbank). Die Sternchen ("*") sind durch das Passwort zu ersetzten. In neueren Wikiversionen ist dies bereits im Assistenten berücksichtigt.
| |
| <pre>
| |
| mysql -u root -p
| |
| | |
| CREATE USER 'mediawiki'@'localhost' IDENTIFIED BY '***';
| |
| GRANT USAGE ON * . * TO 'mediawiki'@'localhost' IDENTIFIED BY '***' ;
| |
| CREATE DATABASE IF NOT EXISTS `mediawiki` ;
| |
| GRANT ALL PRIVILEGES ON `mediawiki` . * TO 'mediawiki'@'localhost';
| |
| </pre>
| |
| | |
| ==== tatsächliche Installation Siehe auch ====
| |
| * [[mediawikiwiki:manual:Running MediaWiki on FreeBSD#FreeBSD 10.1]]<sup>[https://www.mediawiki.org/w/index.php?title=Manual_talk:Running_MediaWiki_on_FreeBSD&oldid=1317311#FreeBSD_10.1]</sup>
| |
| | |
| === ergänzende Installation ===
| |
| | |
| ==== VisualEditor installieren ====
| |
| | |
| Installieren von npm (Paketverwaltung von node.js)
| |
| : <code>pkg install npm</code>
| |
| <!--
| |
| <pre>
| |
| Message for python27-2.7.8_6:
| |
| =====================================================================
| |
| | |
| Note that some standard Python modules are provided as separate ports
| |
| as they require additional dependencies. They are available as:
| |
| | |
| bsddb databases/py-bsddb
| |
| gdbm databases/py-gdbm
| |
| sqlite3 databases/py-sqlite3
| |
| tkinter x11-toolkits/py-tkinter
| |
| | |
| =====================================================================
| |
| Message for node-0.10.33:
| |
| Note: If you need npm (Node Package Manager), please install www/npm.
| |
| </pre>
| |
| -->
| |
| | |
| : <code>pkg install git</code>
| |
| <!--
| |
| <pre>
| |
| Message for python27-2.7.8_6:
| |
| =====================================================================
| |
| | |
| Note that some standard Python modules are provided as separate ports
| |
| as they require additional dependencies. They are available as:
| |
| | |
| bsddb databases/py-bsddb
| |
| gdbm databases/py-gdbm
| |
| sqlite3 databases/py-sqlite3
| |
| tkinter x11-toolkits/py-tkinter
| |
| | |
| =====================================================================
| |
| Message for git-2.1.2_1:
| |
| ------------------------------------------------------------------------
| |
| *************************** GITWEB *************************************
| |
| If you installed the GITWEB option please follow these instructions:
| |
| | |
| In the directory /usr/local/share/examples/git/gitweb you can find all files to
| |
| make gitweb work as a public repository on the web.
| |
| | |
| All you have to do to make gitweb work is:
| |
| 1) Copy the files /usr/local/share/examples/git/gitweb/* to a directory on
| |
| your web server (e.g. Apache2) in which you are able to execute
| |
| CGI-scripts.
| |
| 2) In gitweb.cgi, adjust the variable $projectroot to point to
| |
| your git repository (that is where you have your *.git project
| |
| directories).
| |
| *************************** GITWEB *************************************
| |
| | |
| *************************** CONTRIB ************************************
| |
| If you installed the CONTRIB option please note that the scripts are
| |
| installed in /usr/local/share/git-core/contrib. Some of them require
| |
| other ports to be installed (perl, python, etc), which you may need to
| |
| install manually.
| |
| *************************** CONTRIB ************************************
| |
| ------------------------------------------------------------------------
| |
| </pre>
| |
| -->
| |
| | |
| Wechseln in ein beliebiges Verzeichnis, wo dann Parsoid installiert werden soll
| |
| : <code>cd /usr/local/www</code>
| |
| Klonen (via git) von Parsoid in das aktuelle Verzeichnis
| |
| : <code>git clone https://gerrit.wikimedia.org/r/p/mediawiki/services/parsoid</code>
| |
| | |
| Wechseln in das eben erstellte Verzeichnis, wo Parsoid installiert werden soll
| |
| : <code>cd parsoid</code>
| |
| mit npm verwaltetes Installieren von Parsoid
| |
| : <code>npm install</code>
| |
| | |
| Erzeugen einer vorgefertigten Datei zur Konfiguration von Parsoid
| |
| : <code>cp api/localsettings.js.example api/localsettings.js</code>
| |
| Anpassen der Datei zur Konfiguration von Parsoid
| |
| : <code>$EDITOR api/localsettings.js</code>
| |
| <pre>
| |
| /*
| |
| parsoidConfig.setInterwiki( 'localhost', 'http://localhost/w/api.php' );
| |
| */
| |
| parsoidConfig.setInterwiki( 'localhost', 'http://141.56.50.13/api.php' );
| |
| </pre>
| |
| | |
| Testweises Starten von Parsoid
| |
| : <code>node api/server.js</code>
| |
| :: http://localhost:8000
| |
| :: http://localhost:8000/localhost/Hauptseite
| |
| | |
| Ergänzen der Einträge für Parsoid in die Datei zu Konfiguration von MediaWiki
| |
| : <code>$EDITOR /usr/local/www/mediawiki/LocalSettings.php</code>
| |
| <pre>
| |
| // URL to the Parsoid instance
| |
| // MUST NOT end in a slash due to Parsoid bug
| |
| $wgVisualEditorParsoidURL = 'http://141.56.50.13:8000';
| |
| | |
| // Interwiki prefix to pass to the Parsoid instance
| |
| // Parsoid will be called as $url/$prefix/$pagename
| |
| $wgVisualEditorParsoidPrefix = 'localhost';
| |
| </pre>
| |
| | |
| Heraussuchen der zur Version von MediaWiki passenden Version
| |
| : https://www.mediawiki.org/wiki/Special:ExtensionDistributor/VisualEditor
| |
| Herunterladen des Paketes
| |
| : <code>cd /tmp && curl -Ok# https://extdist.wmflabs.org/dist/extensions/VisualEditor-REL1_24-af11aa1.tar.gz</code>
| |
| Entpacken des Paketes an die passende Stelle, im Unterverzeichnis ''extensions'', wo MediaWiki beheimatet ist
| |
| : <code>cd /tmp && tar -xzf VisualEditor-REL1_24-af11aa1.tar.gz -C /usr/local/www/mediawiki/extensions</code>
| |
| | |
| mit npm verwaltetes Installieren von VisualEditor in dem Verzeichnis der Extention
| |
| : <code>cd /usr/local/www/mediawiki/extensions/VisualEditor && npm install</code>
| |
| | |
| Ergänzen der Einträge für Parsoid in die Datei zu Konfiguration von MediaWiki
| |
| : <code>$EDITOR /usr/local/www/mediawiki/LocalSettings.php</code>
| |
| <pre>
| |
| require_once "$IP/extensions/VisualEditor/VisualEditor.php";
| |
| | |
| // Enable by default for everybody
| |
| $wgDefaultUserOptions['visualeditor-enable'] = 1;
| |
| | |
| // Don't allow users to disable it
| |
| $wgHiddenPrefs[] = 'visualeditor-enable';
| |
| | |
| // OPTIONAL: Enable VisualEditor's experimental code features
| |
| #$wgDefaultUserOptions['visualeditor-enable-experimental'] = 1;
| |
| </pre>
| |
| | |
| Wechseln in das Verzeichnis von Parsoid und dortiges Starten des Dienstes, der dann dort im Hintergrund laufen soll
| |
| : <code>cd /usr/local/www/parsoid && node api/server.js &</code>
| |
| | |
| : <code>$EDITOR /etc/rc.conf.local</code>
| |
| <pre>
| |
| #!/bin/sh
| |
| cd /usr/local/www/parsoid
| |
| su -m www -c 'node api/server.js'
| |
| </pre>
| |
| : chmod 755 /etc/rc.conf.local
| |
| | |
| ==== Semantic MediaWiki installieren ====
| |
| | |
| * [https://www.semantic-mediawiki.org/wiki/Help:Installation SMW installieren]
| |
| ** [https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx Installation *nix Composer]
| |
| | |
| == Siehe auch ==
| |
| * [[mediawikiwiki:Manual:Running MediaWiki on FreeBSD]]
| |
| * [[Server/srs13]]
| |
| | |
| [[Kategorie:Server]]
| |
| [[Kategorie:Software]]
| |
| [[Kategorie:Wiki]]
| |