Difference between revisions of "Setup:Installation Manual/Services and system configuration/Parsoid"
← Setup:Installation Manual/Services and system configuration/Parsoid
[unchecked revision] | [quality revision] |
(Tag: Visual edit) |
The installation of Parsoid requires the installation of Node.js.
The installation can be verified by
$ nodejs --version
$ node -v
$ npm -v
Installation und Konfigurationand Configuration[edit | edit source]
Linux[edit | edit source]
Install Parsoid installieren[edit | edit source]
Es wird auf die Installation aus Paketquellen der Distribution verzichtet. Installiert wird Parsoid unter There is no installation from package sources of the distribution. Parsoid is installed under /usr/local. Hierzu wechseln wir dorthin
For this we move to $ cd /usr/local
Holen von Getting Parsoid:
$ git clone https://gerrit.wikimedia.org/r/p/mediawiki/services/parsoid parsoid
Installation von Installing Parsoid:
$ cd parsoid
$ npm install
Überprüfung der InstallationChecking the installation:
$ npm test
Anlegen der Default -Konfigurationconfiguration:
$ cp config.example.yaml config.yaml
Configuring Parsoid konfigurieren[edit | edit source]
Öffnen der Datei Opening the file config.yaml:
$ vi /usr/local/parsoid/config.yaml
Für die grundlegende Installation von Parsoid ist das Anpassen der URL zur For the basic installation of Parsoid it is sufficient to adjust the URL to the MediaWiki api (uri:) und der and the domain (domain:) ausreichend. Wir empfehlen unbedingt, niemals mit "localhost" zu arbeiten sondern mit dem tatsächlichen vhost-Alias, mit dem das MediaWiki auch von außen erreichbar ist. So vermeiden werden zusätzliche Apache-Konfigurationen vermieden. We strongly recommend never to work with "localhost" but with the actual vhost alias, with which the MediaWiki can also be reached from outside. This avoids additional Apache configurations.
Bei Benutzung des Alias sollte dieser unbedingt mit einer Loopback-IP (127.0.0.1) in der /etc/hosts hinterlegt werden! Dabei ist außerdem darauf zu achten, dass der Webserver nicht auf die externe IP bindet. |
Start Parsoid manuell startenmanually[edit | edit source]
Parsoid kann manuell mit Konsolenausgabe gestartet werdencan be started manually with console output:
$ npm start
Start Parsoid als as Daemon starten[edit | edit source]
Hierzu gibt es mehrere Möglichkeiten. Am ehesten bietet sich pm2 an, da dies mehrere Anwendungen/Dienste in nodejs vereinigt.
Installation von There are several ways to do this. Most likely pm2 is the best choice, because it combines several applications/services in nodejs.
Installation of pm2: $ npm install -g pm2
Starten von Starting Parsoid als as Daemon via pm2:
$ pm2 start /usr/local/parsoid/bin/server.js
Speichern der pm2 Prozessliste - dies fügt Parsoid zu den pm2-Diensten fest hinzuSave the pm2 process list - this will add Parsoid to the pm2 services:
$ pm2 save
pm2 in den System-Autostart legen:
# Render startup-script for a specific platform, the [platform] could be one of:
# ubuntu|centos|redhat|gentoo|systemd|darwin|amazon
$ pm2 startup [platform]
Windows[edit | edit source]
Öffnen Sie eine Konsole mit Administratorberechtigungen und wechseln Sie dort in das Installationsverzeichnis von Node.js (wenn Sie sich an unsere Empfehlungen zur Ordnerstruktur unter Windows gehalten haben \bluespice\bin\nodejs). Führen Sie dort den Befehl npm install parsoid aus.
Contents
-
1 Installation und Konfigurationand Configuration
-
1.1 Linux
- 1.1.1 Install Parsoid installieren
- 1.1.2 Configuring Parsoid konfigurieren
- 1.1.3 Start Parsoid manuell startenmanually
- 1.1.4 Start Parsoid als as Daemon starten
-
1.2 Windows
- 1.2.1 Anlegen der Konfigurationsdatei Creating the configuration file
-
1.1 Linux
- 2Aktivieren von Activating VisualEditor in BlueSpice
Die Konfiguration von Parsoid unter Windows ist nahezu identisch zu Parsoid unter Linux. In dieser Anleitung gibt es dennoch eine Unterscheidung der entsprechenden Artikel aufgrund der unterschiedlichen Pfade im Dateisystem. Auch hier halten wir uns an oben erwähnte Ordnerstruktur und gehen entsprechend von den Pfaden in dieser Dokumentation aus.
Anlegen der KonfigurationsdateiOpen a console with administrator permissions and change to the installation directory of Node.js (if you followed our recommendations for the folder structure under Windows \bluespice\bin\nodejs). Execute the command npm install parsoid there.
The configuration of Parsoid under Windows is almost identical to Parsoid under Linux. In this manual, however, there is a distinction between the corresponding articles due to the different paths in the file system. Here, too, we adhere to the above folder structure and assume the paths in this documentation accordingly.
Creating the configuration file[edit | edit source]
Legen Sie die Datei Create the file \bluespice\etc\parsoid.yaml an. Kopieren Sie folgenden Inhalt in diese. Copy the following content into it:
worker_heartbeat_timeout: 300000 logging: level: info services: # GebenEnter Siethe hierabsolute beipath "module"of den absoluten Pfad der the index.js in "module". # imin Unterordnerthe subfolder "lib" desof the parsoid-Moduls vonmodule of nodejs an. # DerThe erstefirst "/" stelltrepresents dabeithe dietop oberstelevel Ebeneof Ihresyour Laufwerksdrive. # dar. Nutzen Sie keine Don't user "\" sondernbut "/" - module: /bluespice/bin/nodejs/node_modules/parsoid/lib/index.js entrypoint: apiServiceWorker conf: mwApis: # GebenFor Sie bei "uri", dieenter the URL an,where unteryou derwant Siethe die api.php of your MediaWiki # Ihrer MediaWiki-Installation erreichen können. Dies# mussinstallation. This must not be a public address, you #can keineuse öffentlicheit Adressewith sein, Sie können durchaus mit # "localhost" arbeiten, sofernprovided Ihrthat Webserveryour entsprechendweb server is # darauf konfiguriert istconfigured accordingly. - uri: 'http://localhost/api.php' domain: 'bluespice'Die beiden relevanten Änderungen, die Sie selber bei Bedarf anpassen müssen The two relevant changes that you have to adjust yourself ("module" und and "uri") sind im entsprechenden Kommentar darüber erklärt.
Speichern und schließen Sie die Datei.
Aktivieren von are explained in the corresponding comment above.Save and close the file.
Activating VisualEditor in BlueSpice[edit | edit source]
Wechseln Sie in das Verzeichnis Change to the directory <installpath-bluespice>/settings.d. Öffnen Sie die Dateien Open the files
020-BlueSpiceVisualEditorConnector.php und and
020-VisualEditor.php
in einem Texteditor. In der zweiten Zeile finden Sie einen Code, der bei beiden Erweiterungen diese deaktivierta text editor.
In the second line you will find a code that deactivates both extensions:
return; // Disabled. Needs Parsoid
Fügen Sie wahlweise ein Kommentarzeichen (#) an den Anfang dieser Zeile ein oder löschen Sie diese Zeile komplett, speichern die beiden Dateien und verlassen Sie diese wieder.
Öffnen Sie nun eine Kommandozeile und wechseln in den Ordner <installpath-bluespice>
. Führen Sie dort folgenden Befehl ausAdd a comment character (#) to the beginning of this line or delete this line completely, save the two files and exit them again.
Now open a command line and change to the folder <installpath-bluespice>. Execute the following command there:
php maintenance/update.php (Linux) php maintenance\update.php (Windows))
Achten Sie unter On Windows darauf, dass die Umgebungsvariablen korrekt gesetzt sind, um auf den Befehl "php" zugreifen zu können, make sure that the environment variables are set correctly to access the php command. |
Beachten Sie unter Linux, dass Sie nach dem Ausführen der update.php die Dateisystemrechte neu anpassen müssen. |
Note that under Linux, after you run update.php, you must re-customize the file system permisisons. |
As soon as the script is completed with the message "Done", the VisualEditor is successfully activated.
The installation of Parsoid requires the installation of Node.js. The installation can be verified by <source lang="bash"> $ nodejs --version $ node -v $ npm -v </source> ==Installation und Konfigurationand Configuration== ===Linux=== ====Parsoid installieren==== Es wird auf die Installation aus Paketquellen der Distribution verzichtet. Installiert wird Parsoid unter /usr/local. Hierzu wechseln wir dorthin ====Install Parsoid ==== There is no installation from package sources of the distribution. Parsoid is installed under ''/usr/local''. For this we move to<source lang="bash"> $ cd /usr/local </source> Holen von Getting Parsoid: <source lang="bash"> $ git clone https://gerrit.wikimedia.org/r/p/mediawiki/services/parsoid parsoid </source> Installation von Installing Parsoid: <source lang="bash"> $ cd parsoid $ npm install </source> Überprüfung der InstallationChecking the installation: <source lang="bash"> $ npm test </source> Anlegen der Default-KonfigurationDefault configuration: <source lang="bash"> $ cp config.example.yaml config.yaml </source> ====Configuring Parsoid konfigurieren==== Öffnen der Datei==== Opening the file config.yaml: <source lang="bash"> $ vi /usr/local/parsoid/config.yaml </source> Für die grundlegende Installation von Parsoid ist das Anpassen der URL zur MediaWiki api ('''uri:''') und der domain ('''domain:''') ausreichend. Wir empfehlen unbedingt, niemals mit "localhost" zu arbeiten sondern mit dem tatsächlichen vhost-Alias, mit dem das MediaWiki auch von außen erreichbar ist. So vermeiden werden zusätzliche Apache-Konfigurationen vermiedenFor the basic installation of Parsoid it is sufficient to adjust the URL to the MediaWiki api ('''uri:''') and the domain ('''domain:'''). We strongly recommend never to work with "localhost" but with the actual vhost alias, with which the MediaWiki can also be reached from outside. This avoids additional Apache configurations. {{Hint |text=Bei Benutzung des Alias sollte dieser unbedingt mit einer Loopback-IP (127.0.0.1) in der /etc/hosts hinterlegt werden! Dabei ist außerdem darauf zu achten, dass der Webserver nicht auf die externe IP bindet. }} ====Start Parsoid manuell startenmanually==== Parsoid kann manuell mit Konsolenausgabe gestartet werdencan be started manually with console output: <source lang="bash"> $ npm start </source> ====Start Parsoid alsas Daemon starten==== Hierzu gibt es mehrere Möglichkeiten. Am ehesten bietet sich pm2 an, da dies mehrere Anwendungen/Dienste in nodejs vereinigt. Installation von pm2: ==== There are several ways to do this. Most likely pm2 is the best choice, because it combines several applications/services in nodejs. Installation of pm2:<source lang="bash"> $ npm install -g pm2 </source> Starten von Starting Parsoid alsas Daemon via pm2: <source lang="bash"> $ pm2 start /usr/local/parsoid/bin/server.js </source> Speichern derSave the pm2 Prozessliste - dies fügt Parsoid zu den pm2-Diensten fest hinzuprocess list - this will add Parsoid to the pm2 services: <source lang="bash"> $ pm2 save </source> pm2 in den System-Autostart legen: <source lang="bash"> # Render startup-script for a specific platform, the [platform] could be one of: # ubuntu|centos|redhat|gentoo|systemd|darwin|amazon $ pm2 startup [platform] </source> ===Windows=== Öffnen Sie eine Konsole mit Administratorberechtigungen und wechseln Sie dort in das Installationsverzeichnis von Node.js (wenn Sie sich an unsere [[Setup:Installationsanleitung/Kompendium/Ordnerstruktur_unter_Windows|Empfehlungen zur Ordnerstruktur unter Windows]] gehalten haben ''\bluespice\bin\nodejs''). Führen Sie dort den Befehl ''npm install parsoid'' aus. __TOC__ Die Konfiguration von Parsoid unter Windows ist nahezu identisch zu Parsoid unter Linux. In dieser Anleitung gibt es dennoch eine Unterscheidung der entsprechenden Artikel aufgrund der unterschiedlichen Pfade im Dateisystem. Auch hier halten wir uns an oben erwähnte Ordnerstruktur und gehen entsprechend von den Pfaden in dieser Dokumentation aus. ====Anlegen der Konfigurationsdatei==== Legen Sie die Datei __TOC__ Open a console with administrator permissions and change to the installation directory of Node.js (if you followed our recommendations for the [[folder structure under Windows]] ''\bluespice\bin\nodejs''). Execute the command npm install parsoid there. The configuration of Parsoid under Windows is almost identical to Parsoid under Linux. In this manual, however, there is a distinction between the corresponding articles due to the different paths in the file system. Here, too, we adhere to the above folder structure and assume the paths in this documentation accordingly. ====Creating the configuration file==== Create the file ''\bluespice\etc\parsoid.yaml'' an. Kopieren Sie folgenden Inhalt in diese. Copy the following content into it: <pre>worker_heartbeat_timeout: 300000 logging: level: info services: # Geben Sie hier bei "module" den absoluten Pfad der index.js # im Unterordner "lib" des parsoid-Moduls von nodejs an. # Der erste "/" stellt dabei die oberste Ebene Ihres Laufwerks # dar. Nutzen Sie keine "\" sondernEnter the absolute path of the index.js in "module". # in the subfolder "lib" of the parsoid module of nodejs # The first "/" represents the top level of your drive. # Don't user "\" but "/" - module: /bluespice/bin/nodejs/node_modules/parsoid/lib/index.js entrypoint: apiServiceWorker conf: mwApis: # Geben Sie bei "uri" die URL an, unter der Sie die api.php # Ihrer MediaWiki-Installation erreichen können. Dies muss # keine öffentliche Adresse sein, Sie können durchaus mit # "localhost" arbeiten, sofern Ihr Webserver entsprechend # darauf konfiguriert istFor "uri", enter the URL where you want the api.php of your MediaWiki # installation. This must not be a public address, you can use it with # "localhost", provided that your web server is configured accordingly. - uri: 'http://localhost/api.php' domain: 'bluespice'</pre> Die beiden relevanten Änderungen, die Sie selber bei Bedarf anpassen müssen ("module" und "uri") sind im entsprechenden Kommentar darüber erklärt. Speichern und schließen Sie die Datei. ==Aktivieren von VisualEditor in BlueSpice== Wechseln Sie in das Verzeichnis <code><installpath-bluespice>/settings.d</code>. Öffnen Sie die Dateien <br>'''020-BlueSpiceVisualEditorConnector.php''' und <br>'''020-VisualEditor.php'''<br> in einem Texteditor. In der zweiten Zeile finden Sie einen Code, der bei beiden Erweiterungen diese deaktiviertThe two relevant changes that you have to adjust yourself ("module" and "uri") are explained in the corresponding comment above. Save and close the file. ==Activating VisualEditor in BlueSpice== Change to the directory ''<installpath-bluespice>/settings.d''. Open the files '''020-BlueSpiceVisualEditorConnector.php and''' '''020-VisualEditor.php''' in a text editor. In the second line you will find a code that deactivates both extensions: return; // Disabled. Needs Parsoid Fügen Sie wahlweise ein Kommentarzeichen ('''#''') an den Anfang dieser Zeile ein oder löschen Sie diese Zeile komplett, speichern die beiden Dateien und verlassen Sie diese wieder. Öffnen Sie nun eine Kommandozeile und wechseln in den Ordner <code><installpath-bluespice></code>. Führen Sie dort folgenden Befehl aus: Add a comment character '''(#)''' to the beginning of this line or delete this line completely, save the two files and exit them again. Now open a command line and change to the folder ''<installpath-bluespice>''. Execute the following command there: php maintenance/update.php ''(Linux)'' php maintenance\update.php ''(Windows))'' {{Hint |text=Achten Sie unter Windows darauf, dass die [[Setup:Installationsanleitung/Systemkonfigurationen/Umgebungsvariablen|Umgebungsvariablen]] korrekt gesetzt sind, um auf den Befehl "php" zugreifen zu können.}} {{Hint |text=Beachten Sie unter Linux, dass Sie nach dem Ausführen der update.php die [[Setup:Installationsanleitung/Sicherheitseinstellungen/Dateisystemrechte#Verrechtung_unter_Linux|Dateisystemrechte]] neu anpassen müssen.}} Sobald das Script mit der Meldung "Done" abgeschlossen ist, ist der VisualEditor erfolgreich aktiviertOn Windows, make sure that the [[Setup:Installation_Manual/System_Configuration/Environment_Variables|environment variables]] are set correctly to access the php command.}} {{Hint |text=Note that under Linux, after you run update.php, you must re-customize the [[Setup:Installation_Manual/Security_Settings/File_System_Permissions#Assignment_of_Permissions_with_Linux|file system permisisons]].}} As soon as the script is completed with the message "Done", the VisualEditor is successfully activated.<br /><br />
Line 9: | Line 9: | ||
</source> | </source> | ||
− | ==Installation | + | ==Installation and Configuration== |
===Linux=== | ===Linux=== | ||
− | |||
− | |||
− | + | ====Install Parsoid ==== | |
+ | There is no installation from package sources of the distribution. Parsoid is installed under ''/usr/local''. | ||
− | <source lang="bash"> | + | For this we move to<source lang="bash"> |
$ cd /usr/local | $ cd /usr/local | ||
</source> | </source> | ||
− | + | Getting Parsoid: | |
<source lang="bash"> | <source lang="bash"> | ||
Line 26: | Line 25: | ||
</source> | </source> | ||
− | + | Installing Parsoid: | |
<source lang="bash"> | <source lang="bash"> | ||
Line 33: | Line 32: | ||
</source> | </source> | ||
− | + | Checking the installation: | |
<source lang="bash"> | <source lang="bash"> | ||
Line 39: | Line 38: | ||
</source> | </source> | ||
− | + | Default configuration: | |
<source lang="bash"> | <source lang="bash"> | ||
Line 45: | Line 44: | ||
</source> | </source> | ||
− | ====Parsoid | + | ====Configuring Parsoid ==== |
− | + | Opening the file config.yaml: | |
<source lang="bash"> | <source lang="bash"> | ||
Line 52: | Line 51: | ||
</source> | </source> | ||
− | + | For the basic installation of Parsoid it is sufficient to adjust the URL to the MediaWiki api ('''uri:''') and the domain ('''domain:'''). We strongly recommend never to work with "localhost" but with the actual vhost alias, with which the MediaWiki can also be reached from outside. This avoids additional Apache configurations. | |
{{Hint | {{Hint | ||
Line 58: | Line 57: | ||
}} | }} | ||
− | ====Parsoid | + | ====Start Parsoid manually==== |
− | Parsoid | + | Parsoid can be started manually with console output: |
<source lang="bash"> | <source lang="bash"> | ||
Line 65: | Line 64: | ||
</source> | </source> | ||
− | ====Parsoid | + | ====Start Parsoid as Daemon==== |
− | + | There are several ways to do this. Most likely pm2 is the best choice, because it combines several applications/services in nodejs. | |
− | |||
− | |||
− | <source lang="bash"> | + | Installation of pm2:<source lang="bash"> |
$ npm install -g pm2 | $ npm install -g pm2 | ||
</source> | </source> | ||
− | + | Starting Parsoid as Daemon via pm2: | |
<source lang="bash"> | <source lang="bash"> | ||
Line 80: | Line 77: | ||
</source> | </source> | ||
− | + | Save the pm2 process list - this will add Parsoid to the pm2 services: | |
<source lang="bash"> | <source lang="bash"> | ||
Line 95: | Line 92: | ||
===Windows=== | ===Windows=== | ||
− | |||
− | |||
− | |||
__TOC__ | __TOC__ | ||
+ | Open a console with administrator permissions and change to the installation directory of Node.js (if you followed our recommendations for the [[folder structure under Windows]] ''\bluespice\bin\nodejs''). Execute the command npm install parsoid there. | ||
− | + | The configuration of Parsoid under Windows is almost identical to Parsoid under Linux. In this manual, however, there is a distinction between the corresponding articles due to the different paths in the file system. Here, too, we adhere to the above folder structure and assume the paths in this documentation accordingly. | |
− | ==== | + | ====Creating the configuration file==== |
− | + | Create the file ''\bluespice\etc\parsoid.yaml''. Copy the following content into it: | |
<pre>worker_heartbeat_timeout: 300000 | <pre>worker_heartbeat_timeout: 300000 | ||
Line 111: | Line 106: | ||
services: | services: | ||
− | # | + | # Enter the absolute path of the index.js in "module". |
− | # | + | # in the subfolder "lib" of the parsoid module of nodejs |
− | # | + | # The first "/" represents the top level of your drive. |
− | # | + | # Don't user "\" but "/" |
- module: /bluespice/bin/nodejs/node_modules/parsoid/lib/index.js | - module: /bluespice/bin/nodejs/node_modules/parsoid/lib/index.js | ||
entrypoint: apiServiceWorker | entrypoint: apiServiceWorker | ||
conf: | conf: | ||
mwApis: | mwApis: | ||
− | # | + | # For "uri", enter the URL where you want the api.php of your MediaWiki |
− | # | + | # installation. This must not be a public address, you can use it with |
− | + | # "localhost", provided that your web server is configured accordingly. | |
− | # "localhost" | ||
− | |||
- uri: 'http://localhost/api.php' | - uri: 'http://localhost/api.php' | ||
− | domain: 'bluespice'</pre> | + | domain: 'bluespice'</pre>The two relevant changes that you have to adjust yourself ("module" and "uri") are explained in the corresponding comment above. |
− | + | Save and close the file. | |
− | + | ==Activating VisualEditor in BlueSpice== | |
+ | Change to the directory ''<installpath-bluespice>/settings.d''. Open the files | ||
− | + | '''020-BlueSpiceVisualEditorConnector.php and''' | |
− | + | '''020-VisualEditor.php''' | |
− | |||
− | In | + | in a text editor. |
+ | |||
+ | In the second line you will find a code that deactivates both extensions: | ||
return; // Disabled. Needs Parsoid | return; // Disabled. Needs Parsoid | ||
+ | Add a comment character '''(#)''' to the beginning of this line or delete this line completely, save the two files and exit them again. | ||
− | + | Now open a command line and change to the folder ''<installpath-bluespice>''. Execute the following command there: | |
− | |||
− | |||
− | |||
php maintenance/update.php ''(Linux)'' | php maintenance/update.php ''(Linux)'' | ||
php maintenance\update.php ''(Windows))'' | php maintenance\update.php ''(Windows))'' | ||
{{Hint | {{Hint | ||
− | |text= | + | |text=On Windows, make sure that the [[Setup:Installation_Manual/System_Configuration/Environment_Variables|environment variables]] are set correctly to access the php command.}} |
{{Hint | {{Hint | ||
− | |text= | + | |text=Note that under Linux, after you run update.php, you must re-customize the [[Setup:Installation_Manual/Security_Settings/File_System_Permissions#Assignment_of_Permissions_with_Linux|file system permisisons]].}} |
− | + | As soon as the script is completed with the message "Done", the VisualEditor is successfully activated.<br /><br /> |