How to set up letsencrypt on a debian/ubuntu machine. Step by step:
$ apt update
# for apache-using web server
$ apt install certbot python3-certbot-apache
# for nginx-using web server
$ apt install certbot python3-certbot-nginx
# for apache-using web server
$ certbot --apache -d example.com -d www.ejemplo.com -d ...
# for nginx-using web server
$ certbot --nginx -d example.com -d www.ejemplo.com -d ...
If the certificate is unable to find a vhost with the ServerName specified, we need to choose the one with https protocol.
Copy into a backup file the file in /etc/apache2/sites-available/default-ssl.conf
and edit it in order to aim at the recently issued certificate files changing the following lines
SSLCertificateFile /etc/letsencrypt/live/server-name/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/server-name/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
With this configuration, the issued certificate should be trusted and on use by now.