Difference between revisions of "Setup:Installation Manual/Services and system configuration/Parsoid"

[unchecked revision][quality revision]

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.


Hint.jpg
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.

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

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[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))

            


Hint.jpg
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.



Hint.jpg
Beachten Sie unter Linux, dass Sie nach dem Ausführen der update.php die Dateisystemrechte neu anpassen müssen.
Sobald das Script mit der Meldung "Done" abgeschlossen ist, ist der VisualEditor erfolgreich aktiviert
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.


Attachments

Discussions