Updated 07.10.2019: nginx directives
I received many requests to roll out Collabora without Docker, because many Users do not have a Plesk-VPS which is able to run Docker.
More and more Service Provider are working with Virtuozzo-Container or something similar where Docker will not run or is not installable.
Now I want to help you to become ready for Collaboration in Nextcloud.
After a long search in different other blogs, play around with various scripts and resetting my testservers (oh what a fun), I have found something what I’m not looking for and I’m surprised how easy it is 😉
Before you start, please note that you have a valid backup of your VPS!
If you do not have an external backup target, you can contact me for rent a S3-Target.
I usually use the editor nano to edit files, but you can also vi or vim. If you want to use nano, you may need to install it:
apt install nano
Requirements:
-
- root-access via ssh
- Working Nextcloud installation with Collabora online app
- Empty subdomain created in Plesk and secured with SSL
- no running service on port 9980, check with
netstat -tulpen | grep 9980
Step 1: Compiling Collabora
No, we don’t have to compile Collabora (Thx Collabora)
Collabora have released packages for Ubuntu 16.04 and 18.04, Great!
All you have to do is execute the following commands, depending on your Ubuntu Release:
16.04 LTS:
apt install apt-transport-https apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0C54D189F4BA284D echo 'deb https://www.collaboraoffice.com/repos/CollaboraOnline/CODE ./' >> /etc/apt/sources.list apt-get update && apt-get install loolwsd code-brand
18.04 LTS:
apt install apt-transport-https apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0C54D189F4BA284D echo 'deb https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-ubuntu1804 ./' >> /etc/apt/sources.list apt-get update && apt-get install loolwsd code-brand
That’s it
Step 2: Config of Collabora
In this step we have to do the following:
-
- allow the nextcloud-instance to interact
- set the admin-credentials
- make letsencrypt-certs readable to collabora
First edit the configuration-file of Collabora:
nano /etc/loolwsd/loolwsd.xml
and add the following lines into the storage
-section:
<host desc="Regex pattern of hostname to allow or deny." allow="true">127\.0\.0\.1</host> <host desc="Regex pattern of hostname to allow or deny." allow="true">nextcloud\.your-domain\.tld</host>
next set proto
in the net
-section to IPv4
.
and set seccomp
in the security
-section to false
in the admin_console
-section edit the credentials for admin-user:
<username desc="The username of the admin console. Ignored if PAM is enabled.">admin-name</username> <password desc="The password of the admin console. Deprecated on most platforms. Instead, use PAM or loolconfig to set up a secure password.">your-password</password>
Save File now.
Because lool-user does not have read-rights to the path where letsencrypt-files are stored and we don’t want to edit Plesk-System-Rights, we create a script to copy the files and change the owner to lool-user:
nano /etc/cron.weekly/collabora_certs
add the following content and adjust the FQDN:
#!/bin/bash cp /opt/psa/var/modules/letsencrypt/etc/live/office.your-domain.tld/cert.pem /etc/loolwsd/cert.pem cp /opt/psa/var/modules/letsencrypt/etc/live/office.your-domain.tld/privkey.pem /etc/loolwsd/key.pem cp /opt/psa/var/modules/letsencrypt/etc/live/office.your-domain.tld/chain.pem /etc/loolwsd/ca-chain.cert.pem chown lool /etc/loolwsd/cert.pem chown lool /etc/loolwsd/key.pem chown lool /etc/loolwsd/ca-chain.cert.pem systemctl restart loolwsd.service exit 0
Save File and make it executable:
chmod +x /etc/cron.weekly/collabora_certs
Execute script to copy the certs for the first time:
/etc/cron.weekly/collabora_certs
and check if Collabora is running and listen on port 9980:
systemctl status loolwsd.service netstat -tulpen | grep 9980
You can control collabora with the following commands:
systemctl status loolwsd.service systemctl start loolwsd.service systemctl stop loolwsd.service systemctl restart loolwsd.service
Install German Spelling (thx to Chris):
apt update apt install hunspell locales-all hunspell-de-de systemctl restart loolwsd.service
Step 3: vHost-Settings in Plesk
Set the hosting settings in the configured subdomain as follows, disable PHP support

# static files
location ^~ /loleaflet {
proxy_pass https://127.0.0.1:9980;
proxy_set_header Host $http_host;
}
# WOPI discovery URL
location ^~ /hosting/discovery {
proxy_pass https://127.0.0.1:9980;
proxy_set_header Host $http_host;
}
# Capabilities
location ^~ /hosting/capabilities {
proxy_pass https://127.0.0.1:9980;
proxy_set_header Host $http_host;
}
# main websocket
location ~ ^/lool/(.*)/ws$ {
proxy_pass https://127.0.0.1:9980;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $http_host;
proxy_read_timeout 36000s;
}
# download, presentation and image upload
location ~ ^/lool {
proxy_pass https://127.0.0.1:9980;
proxy_set_header Host $http_host;
}
# Admin Console websocket
location ^~ /lool/adminws {
proxy_pass https://127.0.0.1:9980;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $http_host;
proxy_read_timeout 36000s;
}
and disable proxy-mode under nginx settings (not use Apache2)
Step 2 finished.
Step 3: Activate Collabora in Nextcloud
Activate the Collabora Online app in Nextcloud and enter the subdomain created in Plesk.
Now you can edit any document directly in the browser:
Under the following URL you will find the Admin-Console of collabora:
https://office.your-domain.tld/loleaflet/dist/admin/admin.html
Where you can adjust a few things.
That’s it and have fun! 😉
Sources:
36 Gedanken zu „How to deploy Collabora Online Office without Docker in Plesk and connect to Nextcloud on Ubuntu“
Hallo Markus,
danke für das Tutorial. Leider bekomme ich nach der Installation die Meldung „Es konnte keine Verbindung zu ihrem Dokument hergestellt werden. Bitte versuchen Sie es erneut.“
Wie mach ich mich denn am schlausten auf die Suche nach dem Fehler ?
LG,
Holger
Hallo Holger,
ich habe die nginx-Direktiven angepasst. Es hatte sich in der Zwischenzeit etwas an Collabora geändert. Übernimmst Du diese bitte mal und prüfst dann, ob Du ein Dokument öffnen kannst.
Gruß
Markus
Hallo Markus,
ich habe die Direktiven angepasst. Leider immer noch das selbe Problem.
LG,
Holger
Hallo Holger. Habe das ganze noch mal durchgetestet. Läuft. Also irgendwas ist bei Dir noch krumm. Was zeichnen denn die nextcloud-Logs und die Plesk-logs auf? Gruß Markus
Hallo Markus, leider kommt da Wordfence, wenn ich die Zeile aus der log kommentieren möchte, daher meine „Interpretation“:
„htaccess-Datei kann nicht überpüft werden, evtl. nicht lesbar und das „Data“ Verzeichnis ist nicht ausführbar.“
Bei Nextcloud-Log sehe ich nichts „verdächtiges“…
Hallo Holger, leere mal den collabora vhost in plesk mit dem Filemanager, also alle Dateien darin löschen. In den hosting-Einstellungen noch mal prüfen, ob PHP deaktiviert. Eventuell noch CGI deaktivieren und dann noch mal testen.
Im Zweifel die Logs per Mail senden.
Gruß Markus
Hallo Markus!
Da ich auf Plesk verzichte: Kannst Du die komplette nginx config bereitstellen?
Mir fehlen da so ein paar Pfade.
Herzlichen Dank
Christian
Hallo Christian.
Die aktuelle nginx-conf findest Du eigentlich hier:
https://www.collaboraoffice.com/code/nginx-reverse-proxy/
Gruß Markus
Hallo Markus!
Vielen Dank fpr die schnelle Antwort. Ich habe mich aber letztendlich doch für Onlyoffice entschieden.
D. h. kostenpflichtig anstatt kostenlos?
https://github.com/ONLYOFFICE
Tolle Anleitung, hat super funktioniert! Vielen Dank dafür!
Sehr gerne 🙂
Hallo Markus,
ich danke dir auch für das großartige Tutorial, es hat alles auf Anhieb geklappt, echt gute Arbeit 🙂
Ich habe blos beim Öffnen eines Dokumentes einen TimeOut erhalten, und dann nach kurzer Überlegung in der Firewall den Port 9980 geöffnet – voila 🙂
lg Lucy
Hallo Lucy,
Freut mich und Danke für Dein Lob ?
Eigentlich sollte es nicht notwendig sein Port 9980 zu öffnen, da der Zugriff von außen über Port 443 erfolgt. Prüfst Du das bitte nochmal?
Gruß Markus
Hallo Markus,
sehr guter Beitrag, endlich konnte ich Collabora auf meinem vServer unter Plesk installieren und mit Nextcloud verbinden. Eine kleine Frage hätte ich noch:
Ab und zu bekomme ich von Collabora eine Fehlermeldung: „Kein Speicherplatz mehr auf dem Server, kontaktieren Sie bitte den Server-Administrator, um fortzufahren.“ Beim zweiten Aufruf klappt es dann immer die Datei zu öffnen.
Woran kann das liegen? Muss ich in Plesk der Domain mehr Speicher zuordnen?
Viele Grüße
Jürgen
Hallo Jürgen,
Sehr schön, freut mich. ?
Hmm, den Fehler hatte ich noch nicht. Wieviel Platz hast Du denn frei?
Gruß Markus
In der Adminkonsole bei Collabora werden folgende Werte angezeigt:
Zwischenspeichergröße der Speicherstatistik 100
Zeitintervall der Speicherstatistik (in ms) 5000
Zwischenspeichergröße der CPU-Statistik 100
Zeitintervall der CPU-Statistik (in ms) 2500
Maximaler virtueller Speicher für Dokumentenprozess (in MB) – nur reduzieren 0
Maximaler Stapelspeicher für Dokumentenprozess (in MB) – nur reduzieren 8000
Maximal erlaubte Dateigröße zum Schreiben auf die Festplatte (in MB) – nur reduzieren 0
In Plesk Version 17.18.11 Update 36 (CentOS Linux 7.6.1810 (Core) habe ich keine Speicherbeschränkung für die Subdomain eingestellt.
Gruß Jürgen
Hallo Markus,
habe noch eine Fehlermeldung gefunden:
2019-01-26 16:51:34 Error 178.254.xx.xx 404 GET /hosting/capabilities HTTP/1.1 GuzzleHttp/6.3.3 curl/7.29.0 PHP/7.2.14 162 SSL/TLS-Zugriff für nginx
2019-01-26 16:51:34 Error 178.254.xx.xx 404 GET /hosting/capabilities HTTP/1.1 GuzzleHttp/6.3.3 curl/7.29.0 PHP/7.2.14 162 SSL/TLS-Zugriff für nginx
2019-01-26 16:51:34 Error 178.254.xx.xx 404 GET /hosting/capabilities HTTP/1.1 GuzzleHttp/6.3.3 curl/7.29.0 PHP/7.2.14 162 SSL/TLS-Zugriff für nginx
2019-01-26 16:51:34 Error 178.254.xx.xx 14363#0: *13993 open() „/var/www/vhosts/meinvserver.de/collabora.meinvserver.de/hosting/capabilities“ failed (2: No such file or directory) nginx-Fehler
2019-01-26 16:51:34 Error 178.254.xx.xx 14363#0: *13993 open() „/var/www/vhosts/meinvserver.de/collabora.meinvserver.de/hosting/capabilities“ failed (2: No such file or directory) nginx-Fehler
2019-01-26 16:51:34 Error 178.254.xx.xx 14363#0: *13994 open() „/var/www/vhosts/meinvserver.de/collabora.meinvserver.de/hosting/capabilities“ failed (2: No such file or directory) nginx-Fehler
2019-01-26 16:51:34 Error 178.254.xx.xx 14363#0: *13994 open() „/var/www/vhosts/meinvserver.de/collabora.meinvserver.de/hosting/capabilities“ failed (2: No such file or directory) nginx-Fehler
2019-01-26 16:51:34 Error 178.254.xx.xx 14363#0: *13995 open() „/var/www/vhosts/meinvserver.de/collabora.meinvserver.de/hosting/capabilities“ failed (2: No such file or directory) nginx-Fehler
2019-01-26 16:51:34 Error 178.254.xx.xx 14363#0: *13995 open() „/var/www/vhosts/meinvserver.de/collabora.meinvserver.de/hosting/capabilities“ failed (2: No such file or directory) nginx-Fehler
2019-01-26 16:51:35 Access 79.200.42.121 200 POST /loleaflet/173510f/loleaflet.html?WOPISrc=https%3A%2F%2Fwww.next.meinvserver.de%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F13396_ocjswk19c9ap&title=testcollabora.odt&lang=de-DE&closebutton=1&revisionhistory=1 HTTP/2.0 Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0 4.96 K SSL/TLS-Zugriff für nginx
2019-01-26 16:51:36 Error 79.200.42.121 499 GET /loleaflet/173510f/l10n/uno-localizations.json HTTP/2.0 Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0 0 SSL/TLS-Zugriff für nginx
2019-01-26 16:51:36 Error 79.200.42.121 499 GET /loleaflet/173510f/l10n/uno/de.json HTTP/2.0 Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0 0 SSL/TLS-Zugriff für nginx
2019-01-26 16:51:36 Access 79.200.42.121 200 GET /loleaflet/173510f/l10n/help-localizations.json HTTP/2.0 Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0 689 SSL/TLS-Zugriff für nginx
2019-01-26 16:51:37 Warning 79.200.42.121 101 GET /lool/https%3A%2F%2Fwww.next.meinvserver.de%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F13396_ocjswk19c9ap%3Faccess_token%3DuwWvSFnBijaAM4QmcsqkYjBOGu1C9nnb%26access_token_ttl%3D0%26permission%3Dedit/ws?WOPISrc=https%3A%2F%2Fwww.next.meinvserver.de%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F13396_ocjswk19c9ap&compat=/ws HTTP/1.1 Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0 836 SSL/TLS-Zugriff für nginx
Gruß Jürgen
Perfekt!
Analog https://www.collaboraoffice.com/code/linux-packages/ konnte ich mit dieser Anleitung die Installation auf einen Strato VPS mit Plesk unter CentOS installieren. Lediglich das Spelling habe ich nicht geschafft umzustellen. „yum hanspell-de“ ist zwar installiert, Collabora lädt allerdings nur das englische spelling.
Vielen Dank für die Anleitung und das Publizieren auf deinen Blog! *thumbsup
Hallo Markus,
vielen Dank, ein super Beitrag.
Insbesondere gelungen ist die dir der Titel des Beitrags, die genau das Problem bechreibt und mich dadurch zu deiner Seite geführt hat. Alles hat geklappt so wie du es beschrieben hast. Prima! 🙂
Zwei Anmerkungen habe ich.
1. Als absoluter Anfänger (bin jetzt mittelmäßger Anfänger 😛 ) hätte ich aufgehört an folgenden Punkten:
-meine Ubuntu 16.04 als VM bei Strato hat wohl kein apt-transport-https. Vielleicht magst du „apt-get install apt-transport-https“ zur Sicherheit noch hinzufügen oben.
– das gleiche mit nano. vi und vim sind vorhanden. Vielleicht als Hinweis „Edit the the following file with a text editor of your choice, eg. nano vim, vi“
– dann bei der Edition des XML-files die Reihenfolge beachten. Zuerst kommt proto, dann seccomp, dann admin_console. Könnte etwas verwirren.
– Nextcloud schmeisst folgende Fehlermeldung nun: PHP scheint zur Abfrage von Systemumgebungsvariablen nicht richtig eingerichtet zu sein. Der Test mit getenv(„PATH“) liefert nur eine leere Antwort zurück.
Wahrscheinlich ignorierfähig.
2. mir ist der Nutzen von Nginx nicht ersichtlich hier. Es geht auch ohne, aber dann fehlen ja die „zusätzlichen Anweisungen“. Wie sehen die für Apache aus?
Mir ist das ganze Thema Nginx und Apache in Plesk eh nicht klar. Etwas geholfen hat mir https://markus-blog.de/index.php/2018/08/06/installation-nextcloud-13-auf-ubuntu-16-04-mit-plesk/
Aber generell nicht warum ich nginx vorschalten sollte, wenn es zwar schneller ist aber ja eh weiterleitet und dann nur ein zusätzlicher „Layer“ ist. Und wenn es nicht weiterleitet, dann funtzt htaccess nicht mehr, was mir alle WordPressens und sonstwas kaputt macht etc.
Wenn du da mal ein Artikel machen magst wäre ich dir sehr verbunden 🙂
Herzliche Grüße
Malte
https://markus-blog.de/index.php/2018/08/06/installation-nextcloud-13-auf-ubuntu-16-04-mit-plesk/
Hallo Malte,
ich danke Dir für die Hinweise, die ich gleich befolgt und eingebaut habe.
Zu Punkt 2. Mit Plesk geht es nicht ohne nginx, wenn installiert, denn jeder Request wird erst von nginx angenommen und dann an Apache2 weitergereicht. Deshalb wird Apache2 in diesem Artikel deaktiviert, um den zusatzlichen Hop zu umgehen.
zu Fehlermeldung Nextcloud:
ind den php-settings am Ende die folgenden Zeilen eintragen, dann sollte für den fpm-pool die Variable erlaubt werden:
[php-fpm-pool-settings]
env[PATH] = /usr/local/bin:/usr/bin:/bin
Viele Grüße
Markus
herzlichen Dank, funktioniert :- )
Freut mich 🙂
Hallo Markus,
endlich mal eine Anleitung, die zum erhofften Ergebnis führt.
Vielen Dank dafür!
Hallo Martin,
Danke für Dein Feedback 🙂
Gruß Markus
Vielen Dank für deine Anleitung, alles hat wie beschrieben gut geklappt und mir sehr geholfen!
Gerne, freut mich!
Ein kleiner Hinweis noch, ich hatte zuerst keine Rechtschreibprüfung für Deutsch verfügbar. Diese konnte ich jedoch auf folgendem Weg nachinstallieren:
sudo apt-get update
apt-get install hunspell
apt-get -y install locales-all
sudo apt-get install hunspell-de-de
systemctl restart loolwsd.service
Super. Danke Dir. Baue ich noch mit ein! Gruß Markus
Hallo Chris,
kannst du mir sagen wie das analog für CentOS aussehen würde?
Danke Peet
Hallo Peet,
sollte dann folgenderweise installierbar sein:
Gruß
Markus
Hallo Markus,
für CentOS scheints das nicht zu geben:
Kein Paket locales-all verfügbar.
Kein Paket hunspell-de-de verfügbar.
Ich habe aber auch noch nicht gefunden, wie das bei CentOS heisst.
Hallo Oliver,
hunspell-de und locales?
Gruß Markus
Hallo Markus, super Anleitung hat alles super geklappt. Habe noch paar Fragen, vieleicht kannst du es beantworten 😉 Wie kann ich Collabora updaten und wie sieht es aus mit dem CSV-Support bei Spredsheet?
Vielen Dank im Voraus!!!
Hallo Paul,
Danke Dir 🙂
Zum Updaten: Da Du das Repository zu Deinen Paketquellen (/etc/apt/sources.list) hinzugefügt hast, wird Collabora wie jede andere Software auch per apt aktualisiert.
Zu Deiner zweiten Frage kann ich Dir jetzt adhoc keine Auskunft geben. Müsste ich mich mal mit befassen.
Gruß
Markus