How to Install NextCloud to Ubuntu 16.04 when LetEncrypt Certs already installed

Nextcloud version : 12.0.4
Operating system and version: Ubuntu 16.04 LTS
Apache or nginx version ?
PHP version: newest…this is all a new install

I already have LetsEncrypt certs installed and my mydomaln takes me to the Apache2 test page. I’ve started the NextCloud installation but when I run

sudo nextcloud.enable-https lets-encrypt

I get the error:

Waiting for verification…
Cleaning up challenges
Failed authorization procedure. mydomaln (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from mydomaln /.well-known/acme-challenge/0LXfHU_TCe3LD2RzXm0dHsvK20qfSf1c0O86P6OzgoA: "

404 Not Found

404 Not Found


" IMPORTANT NOTES: - The following errors were reported by the server:

Domain: mydomaln
Type: unauthorized
Detail: Invalid response from
mydomaln /.well-known/acme-challenge/0LXfHU_TCe3LD2RzXm0dHsvK20qfSf1c0O86P6OzgoA:
"

404 Not Found

404 Not Found


"

To fix these errors, please make sure that your domain name was
entered correctly and the DNS A record(s) for that domain
contain(s) the right IP address.

Is the problem I already have certs installed? Can I use the custom option to apply existing certs to NextCloud installation like:
sudo nextcloud.enable-https custom

If so where are the 3 tiles needed located?

Any help would be appreciated.

Thanks,
Tony Z

I tried the custom pointing to my lets encrypt pem files and I got back the message
Installing custom certificate… done

when I goto my site https://mydomain.com all I get is apache2 test page…

Point DNS of the domain you want to use to the server, and use the --expand flag with certbot to add another domain.

If you use the certonly option you can define the webroot you’ve set in the apache config, for example:

sudo /etc/certbot-auto certonly --expand --webroot -w /var/www/nextcloud -d orig.domain -d new.domain

I tried this command and it didn’t work. First, certbot-auto was located in \opt\letsencrypt and my netcloud folder is under/snap/netcloud. so I tried:

sudo /opt/letsencrypt/certbot-auto certonly --expand --webroot -w /snap/nextcloud -d zdatareports.com

resulted in

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for zdatareports.com
Using the webroot path /snap/nextcloud for all unmatched domains.
Waiting for verification…
Cleaning up challenges

my h t t p s: // zdatareports still ends up pointing to my apache2 index.html
I restarted apache but still not working.

Oh you’re using snap installation. I’ll move the topic…

I don’t even know what that means. I followed this

everything worked until I got to
sudo nextcloud.enable-https lets-encrypt

I solved my problem by wiping my Ubuntu installation and starting over. I followed a different installation guide which got me mostly through it…then another to complete it correctly. I’m up and running.

any chance you have the guides? I’m having a hell of a time getting this working.


based on
https://www.c-rieger.de/