SNAP, NEXTCLOUD, HTTPS, LetsEncrypt

IIS, Apache
Post Reply
androidoff
Posts: 2
Joined: Fri Jan 24, 2020 10:04 am

SNAP, NEXTCLOUD, HTTPS, LetsEncrypt

Post by androidoff » Fri Jan 24, 2020 10:49 am

Okey, Hi all.
I've got Ubuntu 18.04 Server installation, with Nextcloud server installed via snap.
It works perfectly via https protocol with letsencrypt certificates, on my worldwide web-domain. No problems.

Than I try to install OnlyOffice via SNAP on the same server. Installation is Ok, I've changed HTTP port with no problem. It opens and shows start page.
Than I try to change HTTPS port as it told here: via command:

Code: Select all

# snap set onlyoffice-ds onlyoffice.ds-ssl-port=444
To change port to 444. But I cant see it in the config files anywhere. I've restarted service, of course. If I try to change manually ds.conf in /var/snap/onlyoffice-ds/current/etc/onlyoffice/documentserver/nginx/ as shown in ds-ssl.conf.templ file nearly, but it seems to be autogenerated and all changes vanishes after service restarts. File contains only this paramenetrs shown below:

Code: Select all

include /var/snap/onlyoffice-ds/15/etc/nginx/includes/http-common.conf;
server {
  listen 0.0.0.0:80;
  listen [::]:80 default_server;
  server_tokens off;

  include /var/snap/onlyoffice-ds/15/etc/nginx/includes/ds-*.conf;
}
Also there is the same autogenerated file with the same code inside here: var/snap/onlyoffice-ds/current/etc/nginx/conf.d/ As I guess, only office starts to run via https automatically, as soon as you put certs in the /var/snap/onlyoffice-ds/current/var/www/onlyoffice/Data/certs/ folder.

So. I've installed onlyoffice via snap nearly, on free virtual server, with the same configuration, generated self-signed certificates, and tried to connect with nextloud on separated server, on standard http&https ports. I'have an error, which says that self signed certificates are prohibited. Image

So. because I can't manually edit autogenerated config, I can't put there path to certs, generated by letsencrypt, as shown in manual here: (installed without snap)

Ok. How can I install certs, generated by letsencrypt service (they are *.pem extension, no *.key or *.crt), on onlyoffice server, installed by snap? And how can I do it not on the separate server, but on the same with nextcloud server???

Thank you very much for any ideas.
Attachments
self.png
self.png (5.63 KiB) Viewed 1099 times

Carl
Posts: 375
Joined: Thu Apr 12, 2018 10:00 am

Re: SNAP, NEXTCLOUD, HTTPS, LetsEncrypt

Post by Carl » Fri Jan 24, 2020 11:51 am

Hello androidoff,

To switch the Document Server installed via snap, you need to place your ssl certificate and key to /var/snap/onlyoffice-ds/current/var/www/onlyoffice/Data/certs/
Let's Encrypt certificates with .pem extension can be renamed (fullchain.pem => onlyoffice.crt, privkey.pem => onlyoffice.key).

Don't forget to restart the Document Server via snap restart onlyoffice-ds

Let me know if the issue persists.

androidoff
Posts: 2
Joined: Fri Jan 24, 2020 10:04 am

Re: SNAP, NEXTCLOUD, HTTPS, LetsEncrypt

Post by androidoff » Fri Jan 24, 2020 12:52 pm

Yeah! Thank you very-very much! It works! I've just copied and renamed .pem files to .crt & .key the way you've said, and put them to /var/snap/onlyoffice-ds/current/var/www/onlyoffice/Data/certs/

Great! I've spent two days, trying to solve the problem. Carl, you're my savior! Thanks again!

Post Reply