Hintergrund: Eigene Online-Office Suite als reine Web-Anwendung, OpenSource, basierend auf LibreOffice
Installation erfolgt auf einer Test-Maschine die als Ubuntu 18.04 (Server) neu aufgesetzt wurde.
Voraussetzung:
Collabora arbeitet nicht "allein", sondern benötigt eine Sync&Share-Anwendung, die sich als Basis eignet. In diesem Beispiel wird eine Nextcloud-Installation verwendet. Collabora wird von dieser Installation aus als WOBI-URL eingebunden
1. Installation Von Nextcloud
1.1 Benötigte Ubuntu-Pakete installieren und Apache Module aktivieren
apt-get install apache2 mariadb-server libapache2-mod-php apt-transport-https
apt-get install php php-common php-curl php-gd php-imagick php7.2-json php-mbstring php-mysql php7.2-opcache php-pear php-pgsql php7.2-readline php-xml php-xmlrpc php-zip
a2enmod ssl
a2enmod rewrite
a2enmod proxy
a2enmod mod_proxy
a2enmod mod_proxyproxy_wstunnel
a2enmod proxy_wstunnel
a2enmod proxy_http
1.2 Download von Netxcloud
Der Download erfolgt über diese Adresse:
https://download.nextcloud.com/server/releases/nextcloud-15.0.4.zip
Entpacken nach:
/var/www/html/netxcloud
1.3 Anlegen einer Site-Configuration im Apache mit der Datei /etc/apache2/sites-avaliable/netxtcloud.conf:
Alias /nextcloud "/var/www/html/nextcloud/"
<Directory /var/www/html/nextcloud/>
Options +FollowSymlinks
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/html/nextcloud
SetEnv HTTP_HOME /var/www/html/nextcloud
</Directory>
Anschließend aktivieren mitb "a2ensite nextcloud"
1.4 Einrichten einer Mariadb-Datenbank:
create database nextcloud character set utf8 collate utf8_bin;
grant select,insert,update,delete,create,drop,alter,index on nextcloud.* to 'nextcloud'@'localhost' identified by '<passwd>';
1.5 Erst-Konfiguration Nextcloud
Im Browser aufrufen:
https://<meinserver.<meinedomain>.de/nextcloud/index.php
• Administrator: admin <adminpasswd>
• Datenbank: localhost, User nextcloud, Passwort <passwd>
Optional: Anbindung an einen AD-Controller
• LDAP-Authentifikation (AD)
• Modul LDAP aktivieren (Einstellungen-> AddOns)
• Administraton -> LDAP/AD Integration
- Host: <AD-Domäne>
- User-DN: AD-User
- Base-DN: <Domänen-Basis>
- Filter:(&(objectCategory=Person)(sAMAccountName=*)(!(UserAccountControl:1.2.840.113556.1.4.803:=2)))
2. Collabora-Installations-Beschreibung für Ubuntu 16.04:
Beschreibung unter
https://www.collaboraoffice.com/code/ und
https://www.collaboraoffice.com/code/#packages_for_linux_x86_64_platform
Falls ein Proxy verwendet werden muss, wird dieser in der apt-Konfiguration angegeben:
Datei: /etc/apt/apt.conf.d/00proxy
Acquire::http::Proxy "http://proxy.example.de:80";
Acquire::https::Proxy "http://proxy.example.de:80";
2.1 Hinzufügen der Repositories für Collabora
# import the signing key
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0C54D189F4BA284D
# add the repository URL to /etc/apt/sources.list
echo 'deb https://collaboraoffice.com/repos/CollaboraOnline/CODE ./' >> /etc/apt/sources.list
2.2 Installation der collabora-Pakete
# perform the installation
apt-get update && apt-get install loolwsd code-brand
2.3 Anpassen der Konfiguration für den "Libre Office Online Websocket Daemon" (loolwsd) unter /etc/loolwsd/loolwsd.xml Diese ist ein zentraler Punkt und muss etwas genauer vorgestellt werden. Hier ist eine Beispiel-Konfiguration abgebildet, zu verändernde Parameter sind fett hervorgehoben:
<config> |
Wichting sind hierdiese Abschnitte
- "net": Sollte die Verbindung zwischen Nextcloud und loolwsd nicht zustande kommen, kann es helfen, die Verwendung des IPv6 auszuschalten und die Version 4 (=IPv4) zu erzwingen. Da es sich um interne Kommunikation handelt, hat diese Einstellung keine Auswirkungen auf die Kommunikation mit dem Client.
- "ssl": Die Kommunikation zwischen dem Browser und dem loolwsd läuft SSL-verschlüsselt. eine Änderung auf unverschlüsselte Kommunikation durch den Parameter "termination" und Anpassung der Apache-Konfig war in meiner Konfiguration nicht hilfreich. Hier kann aber der SSH-Key nebst Zertifikat aus dem Apache-Store verwendet werden, er muss aber an den angegeben Ort kopiert werden, weil der User lool nicht den Private Key aus dem Apache-Store einsehen darf und eine Öffnung der Rechte nicht sinnvoll wäre.
- "security" Sollte eine Virtualisierungsumgebung verwendet werden, die das kernel-Modul "seccomp" nicht verwendet (wie z.B. "Virtuozzo"), kann dieses mit dem Parameter "seccomp" auf "alse" ausgeschaltet werden. Vorsicht: der Parameter "capabilities" muss aber auf "true" bleiben, weil anderenfalls lool die benötigte Datei nicht findet und mit der Fehlermeldung, der Dateityp könne nicht ermittelt werden, seine Arbeit verweigert.
- "storage": Alle Server bzw. Adressen, die den lool nutzen sollen, müssen hier jeweils als separate Zeile ergänzt werden.
2.4 Starten der Collabora Software
systemctl start loolwsd.service
2.5 Anpassen der Apache Config
Anlegen einer Site-Konfig für Apache unter /etc/apache2/sites-avaliable/lool.conf
<VirtualHost *:443>
ServerName collabora.example.com:443
# SSL configuration, you may want to take the easy route instead and use Lets Encrypt!
SSLEngine on
SSLCertificateFile /path/to/signed_certificate
SSLCertificateChainFile /path/to/intermediate_certificate
SSLCertificateKeyFile /path/to/private/key
SSLProtocol all -SSLv2 -SSLv3
SSLCipherSuite ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS
SSLHonorCipherOrder on
# Encoded slashes need to be allowed
AllowEncodedSlashes NoDecode
# Container uses a unique non-signed certificate
SSLProxyEngine On
SSLProxyVerify None
SSLProxyCheckPeerCN Off
SSLProxyCheckPeerName Off
# keep the host
ProxyPreserveHost On
# static html, js, images, etc. served from loolwsd
# loleaflet is the client part of LibreOffice Online
ProxyPass /loleaflet https://127.0.0.1:9980/loleaflet retry=0
ProxyPassReverse /loleaflet https://127.0.0.1:9980/loleaflet
# WOPI discovery URL
ProxyPass /hosting/discovery https://127.0.0.1:9980/hosting/discovery retry=0
ProxyPassReverse /hosting/discovery https://127.0.0.1:9980/hosting/discovery
# Main websocket
ProxyPassMatch "/lool/(.*)/ws$" wss://127.0.0.1:9980/lool/$1/ws nocanon
# Admin Console websocket
ProxyPass /lool/adminws wss://127.0.0.1:9980/lool/adminws
# Download as, Fullscreen presentation and Image upload operations
ProxyPass /lool https://127.0.0.1:9980/lool
ProxyPassReverse /lool https://127.0.0.1:9980/lool
ProxyPass /hosting/capabilities https://127.0.0.1:9980/hosting/capabilities retry=0
ProxyPassReverse /hosting/capabilities https://127.0.0.1:9980/hosting/capabilities
</VirtualHost>
Anschließend aktivieren mit a2ensite lool
3. Einbinden in Nextcloud:
3.1 Vorbereitung
Das Plugin für Collabora muss in Nextcloud aus dem Repository von Nextcloud eingebunden werden. Falls der Server die Verbindung nur über einen Proxy aufbauen kann, muss die folgende Einstellung vorgenommen werden:
Ergänzen in der /var/www/html/nextcloud/config/config.php
'proxy' => 'http://proxy.hs-owl.de:80',
Achtung: Diese Einstellung wird nur für Aktivierung des Collabora-Plugins benötigt. Zur weiteren Konfiguration muss sie wieder entfernt werden, weil sonst der interne Socket nach localhost nicht gefunden wird!!!
Falls für die lool-Umgebung Self Signed Certs verwendt werden, müssen diese im PHP noch übernommen werden:
#sudo -u www-data php /var/www/nextcloud/occ security:certificates:import /etc/ssl/certs/ssl-cert-snakeoil.pem
Sicherheitstechnisch besser ist jedoch, auch hier offizielle Zertifikate zu verwenden.
3.2 Konfiguraton in Nextcloud
Im Web-Portal von Nextcloud als admin-User anmelden und dort unter "Einstellungen" -> "Apps" -> "Büro&Text" ->"Collabora Online" aktivieren
Dann unter Einstellungen->Administration->Collabora Online die neue URL einstellen:
https://<collabora-server>
Fertig!
Nun können ODT- und Word-Dateien direkt im Portal bearbeitet werden, ohne sie herunter zu laden oder Browser-Plugins zu benutzen. Auch Versionen und gemeinsame Bearbeitung ist hier möglich!
Nachtrag zu Ubuntu 20.04
Bei der Installation unter Ubuntu 20.04 feht dem Paket "loolwsd" ein Paket, das nicht aus dem Ubuntu-Repository entnommen werden kann. Es handelt sich dabei um libpng12, das unter Focal Fossa dirch libpng16 ersetzt wurde. Leider verweigert loolwsd dadurch die Installation. Abhilfe schafft hier, da Paket manuell nachzuinstallieren, da es problemlos parallel zu pibpng16 installiert werden kann.
Als Quelle dient hier Launchpad, das die benötigte Datei direkt zum Download bereit stellt. Der benötigte Befehl lautet demnach zurzeit (Stand: 2021-09-29):
wget https://launchpad.net/~ubuntu-security/+archive/ubuntu/ppa/+build/15108504/+files/libpng12-0_1.2.54-1ubuntu1.1_amd64.deb apt install ./libpng12-0_1.2.54-1ubuntu1.1_amd64.deb
Anschließen können die Pakete "loolwsd" und "code-brand" wie oben beschrieben nachinstalliert werden.