In this post we we’ll address the following, very specific scenario:
We wan’t to use the OnlyOffice Document Server on a Subdomain (for example office.endorwind.de) together with other subdomains and want to secure this connection via HTTPS and Let’s Encrypt certificate. We will use Apache2 as our webserver and Ubuntu 16.04 as our OS.
In this tutorial I will only address the steps, with differ from a standard OO installation, for – let’s say – Nginx.
Step 1 – Install OO Document Server using Docker
First of all we’ll install the OO Document Server using docker. If you don’t have Docker already installed follow this tutorial.
sudo docker run --restart=always -i -t -d -p 8888:443 -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data onlyoffice/documentserver
With the above command we bind port 8888 to port 443. You can change the 8888 port to whatever port you like.
Step 2 – Create a new domain and install LE certificate
Follow this tutorial to set up a domain with Apache and follow this tutorial to install a certificate with Let’s Encrypt for this domain.
Step 3 – Configure Apache as Proxy
Now the magic happens: Go into your Apache2 config file for the domain you are using (if you followed the linked tutorials it should be office.endorwind.de.conf ) and replace the *.443 VirtualHost with the following:
<VirtualHost *:443> ServerName office.endorwind.de SSLEngine on SSLProxyEngine on SSLProxyVerify none SSLProxyCheckPeerCN off SSLProxyCheckPeerName off SSLCertificateFile /etc/letsencrypt/live/office.endorwind.de/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/office.endorwind.de/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf ProxyPreserveHost On ProxyPass / https://office.endorwind.de:8888/ ProxyPassReverse / https://office.endorwind.de:8888/ </VirtualHost>
Then enable the Apache HTTP Proxy Module with
sudo a2enmod proxy_http
and restart Apache.
Hi!
Ich habe Deinen Post zum o.g. Thema gelesen und gehofft, dass ich damit endlich Onlyoffice (Docker) und Nextcloud auf dem selben Server laufen lassen kann. Leider klappt das trotzdem nicht. Bei Dir scheint es ja geklappt zu haben, vielleicht kannst Du keinen Denkfehler erkennen. Hier einmal eine kurze Beschreibung meines Weges:
Docker Installiert
sudo docker run –restart=always -i -t -d -p 8888:443 -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data onlyoffice/documentserver#
vhost erstellt, letsencrypt drüber (office.domain.net)
Zertifikate (office.domain.net) für OO bereitgestellt ( Letsencrypt, .key und .cert liegen in/app/onlyoffice/DocumentServer/data/certs)
office.domain.net-le-ssl.conf bearbeitet, d.h. deinen Code aus dem Tutorial reingepackt und angepasst.
office.domain.net.conf sieht gleichzeitig wie folgt aus
ServerName office.domain.net
RewriteEngine on
RewriteCond %{SERVER_NAME} =office.domain.net
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI}[END,QSA,R=permanent]
service apache2 restart
Leider bekomme ich dann immer nur einen 503 zurück.
proxy-modul ist selbstverständlich aktiv.
Ohne HTTPS bekomme ich den Server ohne Probleme ans laufen… Es scheint also irgend etwas mit der HTTPS-Konfiguration zu tun zu haben.
Hast Du eine Idee?
Über eine Antwort würde ich mich sehr freuen!
Am besten mal den Error Log von Apache durchlesen und eventuell hier posten, zu finden unter /var/log/apache2/error.log
Was meinst Du mit ohne HTTPS: Die Verbindung vom Client zum Server oder das Rerouting im Server selbst?
Error Log nennt insb. [Mon Apr 02 11:13:58.956672 2018] [proxy:error] [pid 14307] (111)Connection refused: AH00957: HTTPS: attempt to connect to 173.249.XX.XX:8888 (office.domain.net) failed
[Mon Apr 02 11:13:58.956742 2018] [proxy:error] [pid 14307] AH00959: ap_proxy_connect_backend disabling worker for (office.domain.net) for 60s
[Mon Apr 02 11:13:58.956751 2018] [proxy_http:error] [pid 14307] [client 78.34.XXX.XXX:56891] AH01114: HTTP: failed to make connection to backend: office.domain.net, referer: https://office.domain.net/
Mit ohne HTTPS meine ich, dass der OO-Doc-Server im Docker-Container, wenn ich ihn über HTTP laufen lasse, wunderbar funktioniert.
Danke!
Sebastian
Solange der OO Server und Nextcloud auf dem selben Server laufen, sollte das kein Problem darstellen.
Ich muss außerdem gestehen, dass ich nicht wirklich weiß, wo das Problem bei Dir liegen könnte.