1

I've successfully created a site (2 virtualhost, I've another site at the same domain) using apache2 on Debian 9 Stretch (Raspian since is a raspberry) .

It's stored in at this path: /var/www/html/www.mysite.ddns.net/www/. I can access to it following the link: mysite.ddns.net

Now I'd like to setup an https connection so I tried to use Let's encrypt using Certbot

Unfortunately when I run the command sudo certbot --apache, it gives me this error:

Obtaining a new certificate
Performing the following challenges:
Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA.
Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA.

Where is the problem?

  • Can you use the -certonly option and then manually configure Apache to use the certificate? – ivanivan Apr 3 '18 at 14:34
  • @ivanivan I imagine that I can, but how? Something like: sudo certbot -certonly? This is what I obtain: certbot: error: File not found: ertonly – Timmy Apr 3 '18 at 15:50
1

The automated certbot --apache mode may not be working since your site's URL does not exactly match the root directory you are using in Apache.

One option is to manually specify the domain name that will be used for the certificate as well as the web server's root directory.

certbot certonly --webroot -w /var/www/html/www.mysite.ddns.net/www/ -d mysite.ddns.net

This command uses /var/www/html/www.mysite.ddns.net/www/ as your web server's root directory. Certbot will place temporary files (unique to your domain name) there in a directory by the name .well_known and will then attempt to read those files at http://mysite.ddns.net/.well_known. If it finds these files, you will be granted a certificate.

The certificate files will be placed in /etc/letsencrypt/live/mysite.ddns.net/.

To configure Apache to use these certificates, you can add them to your Apache site config with the following:

SSLEngine on
SSLCertificateKeyFile /etc/letsencrypt/live/mysite.ddns.net/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/mysite.ddns.net/fullchain.pem

Make sure to also run a2enmod ssl to ensure that the SSL module for Apache is enabled.

There are also some more Certbot examples to look at in the user guide.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.