Trouble with setup Lets Encrypt for Unifi

Hello all,

I am having some problems with the certificate for my site

I think there is some issues with the forwarding perhaps.

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g., so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:

I ran this command: sudo certbot --apache

It produced this output:
root@fs-media:/home/anders# sudo certbot --apache --domains
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for
Waiting for verification…
Cleaning up challenges

We were unable to find a vhost with a ServerName or Address of
Which virtual host would you like to choose?

1: 000-default.conf | | | Enabled
2: 000-default-le-ssl.conf | | HTTPS | Enabled

Select the appropriate number [1-2] then [enter] (press ‘c’ to cancel): 2
Deploying Certificate to VirtualHost /etc/apache2/sites-enabled/000-default-le-ssl.conf

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.

1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you’re confident your site works on HTTPS. You can undo this
change by editing your web server’s configuration.

Select the appropriate number [1-2] then [enter] (press ‘c’ to cancel): 2
Enhancement redirect was already set.

Congratulations! You have successfully enabled

You should test your configuration at:


  • Congratulations! Your certificate and chain have been saved at:
    Your key file has been saved at:
    Your cert will expire on 2020-04-26. To obtain a new or tweaked
    version of this certificate in the future, simply run certbot again
    with the “certonly” option. To non-interactively renew all of
    your certificates, run “certbot renew”

  • If you like Certbot, please consider supporting our work by:

    Donating to ISRG / Let’s Encrypt:
    Donating to EFF:

My web server is (include version): Apache

The operating system my web server runs on is (include version): Ubuntu 18.04

My hosting provider, if applicable, is: Freenom

I can login to a root shell on my machine (yes or no, or I don’t know): YES

I’m using a control panel to manage my site (no, or provide the name and version of the control panel): Yes

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot): N/A

1 Like

Hi @andersovreseth

if you have such a message, your configuration is buggy.

There are checks of your domain, last is 15 minutes old -

The certificate is wrong

CN=UniFi, OU=UniFi,, L=San Jose, S=CA, C=US
expires in 767 days	UniFi - 1 entry

but you have created a certificate:

Issuer not before not after Domain names LE-Duplicate next LE
Let’s Encrypt Authority X3 2020-01-27 2020-04-26
1 entries duplicate nr. 1

What says

apachectl -S
1 Like

Hi @andersovreseth,

Can you please post your apache vhost configurations and the unifi file? You may want to check out this project.

1 Like

Hello! Thanks for the reply! I ran the command;

root@fs-media:/home/anders# apachectl -S
VirtualHost configuration:
*:443 (/etc/apache2/sites-enabled/000-default-le-ssl.conf:4)
*:80 fs-media.localdomain (/etc/apache2/sites-enabled/000-default.conf:1)
ServerRoot: “/etc/apache2”
Main DocumentRoot: “/var/www/html”
Main ErrorLog: “/var/log/apache2/error.log”
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/run/apache2/" mechanism=default
Mutex watchdog-callback: using_defaults
Mutex proxy-balancer-shm: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
PidFile: “/var/run/apache2/”
User: name=“www-data” id=33
Group: name=“www-data” id=33

1 Like


you see the problem. There is no port 80 vHost with

Perhaps delete / disable the 443 vHost (first: Make a backup), create a correct port 80 vHost.

Then again apachectl -S.

If that is ok, try

certbot --reinstall -d

Certbot should find the existing certificate and should create a correct port 443 vHost.


Great, thanks that solved it for me!


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.