# Unable to generate certificate on Apache

**URL:** <https://community.letsencrypt.org/t/unable-to-generate-certificate-on-apache/153614>\
**Category:** Help\
**Created:** [June 11, 2021, 4:12pm UTC](https://community.letsencrypt.org/t/unable-to-generate-certificate-on-apache/153614 "2021-06-11T16:12:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnvb](https://avatars.discourse-cdn.com/v4/letter/j/d9b06d/32.png) [@johnvb](https://community.letsencrypt.org/u/johnvb)\
**Post date:** [June 11, 2021, 4:12pm UTC](https://community.letsencrypt.org/t/unable-to-generate-certificate-on-apache/153614/1 "2021-06-11T16:12:39Z")

</div>

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. [crt.sh | example.com](https://crt.sh/?q=example.com)), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is: [http://www.erccis-warehouse.org.uk/](http://www.erccis-warehouse.org.uk/)

I ran this command: sudo certbot certonly --apache --dry-run -v

It produced this output:  
Saving debug log to /var/log/letsencrypt/letsencrypt.log  
Plugins selected: Authenticator apache, Installer apache

Which names would you like to activate HTTPS for?

* * *

1: [www.erccis-warehouse.org.uk](http://www.erccis-warehouse.org.uk)

* * *

Select the appropriate numbers separated by commas and/or spaces, or leave input  
blank to select all options shown (Enter 'c' to cancel): 1  
Simulating a certificate request for [www.erccis-warehouse.org.uk](http://www.erccis-warehouse.org.uk)  
Performing the following challenges:  
http-01 challenge for [www.erccis-warehouse.org.uk](http://www.erccis-warehouse.org.uk)  
Waiting for verification...  
Challenge failed for domain [www.erccis-warehouse.org.uk](http://www.erccis-warehouse.org.uk)  
http-01 challenge for [www.erccis-warehouse.org.uk](http://www.erccis-warehouse.org.uk)

Certbot failed to authenticate some domains (authenticator: apache). The Certificate Authority reported these problems:  
Domain: [www.erccis-warehouse.org.uk](http://www.erccis-warehouse.org.uk)  
Type: unauthorized  
Detail: Invalid response from [http://www.erccis-warehouse.org.uk/.well-known/acme-challenge/oNNyHI9U4FSoLNrnNj1erzkqj3G56DnE6Ma\_uhKTK2M](http://www.erccis-warehouse.org.uk/.well-known/acme-challenge/oNNyHI9U4FSoLNrnNj1erzkqj3G56DnE6Ma_uhKTK2M) [2a07:7800::138]: " \<meta charset="UTF-8"\> \<meta name="viewport" content="width=device-width, initial-scale=1.0"\> \<meta http-equiv=""

Hint: The Certificate Authority failed to verify the temporary Apache configuration changes made by Certbot. Ensure that the listed domains point to this Apache server and that it is accessible from the internet.

Cleaning up challenges  
Some challenges have failed.  
Ask for help or search for solutions at [https://community.letsencrypt.org](https://community.letsencrypt.org). See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.

My web server is (include version): Apache 2.4.41

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

My hosting provider, if applicable, is: Eco Web Hosting -[https://www.ecowebhosting.co.uk/](https://www.ecowebhosting.co.uk/).

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): no

The version of my client is (e.g. output of `certbot --version` or `certbot-auto --version` if you're using Certbot): certbot 1.16.0

---

<div class="post-metadata">

**Author:** ![Osiris](https://avatars.discourse-cdn.com/v4/letter/o/839c29/32.png) [@Osiris](https://community.letsencrypt.org/u/Osiris)\
**Post date:** [June 11, 2021, 4:14pm UTC](https://community.letsencrypt.org/t/unable-to-generate-certificate-on-apache/153614/2 "2021-06-11T16:14:59Z")

</div>

Your site has an IPv6 address configured which is responding in a whole different way compared to the IPv4 address configured. Let's Encrypt prefers IPv6.

Could it be the IPv6 addres is not actually the address of your server?

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [June 11, 2021, 4:15pm UTC](https://community.letsencrypt.org/t/unable-to-generate-certificate-on-apache/153614/3 "2021-06-11T16:15:04Z")

</div>

The domain resolves to both IPv4 and IPv6 addresses.  
They don't both work:

```nohighlight
curl -4Iki http://www.erccis-warehouse.org.uk/
HTTP/1.1 302 Found
Date: Fri, 11 Jun 2021 16:13:53 GMT
Server: Apache/2.4.41 (Ubuntu)
Set-Cookie: kohanasession=2tcv09m0ckqrmap8apvdr4eb1q; expires=Fri, 11-Jun-2021 18:13:53 GMT; Max-Age=7200; path=/
Set-Cookie: kohanasession=2tcv09m0ckqrmap8apvdr4eb1q; expires=Fri, 11-Jun-2021 18:13:53 GMT; Max-Age=7200; path=/
Set-Cookie: kohanasession_data=c2Vzc2lvbl9pZHxzOjI2OiIydGN2MDltMGNrcXJtYXA4YXB2ZHI0ZWIxcSI7dG90YWxfaGl0c3xpOjE7X2tmX2ZsYXNoX3xhOjA6e311c2VyX2FnZW50fHM6MTE6ImN1cmwvNy41OC4wIjtpcF9hZGRyZXNzfHM6MTE6Ijc1LjUxLjAuMTU0IjtsYXN0X2FjdGl2aXR5fGk6MTYyMzQyODAzMztyZXF1ZXN0ZWRfcGFnZXxzOjQ6ImhvbWUiOw%3D%3D; expires=Fri, 11-Jun-2021 18:13:53 GMT; Max-Age=7200; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Location: http://www.erccis-warehouse.org.uk/index.php/login
Content-Type: text/html; charset=UTF-8

curl -6Iki http://www.erccis-warehouse.org.uk/
curl: (56) Recv failure: Connection reset by peer

```

The IPv6 address fails and LE prefers IPv6 when present.

---

<div class="post-metadata">

**Author:** ![Osiris](https://avatars.discourse-cdn.com/v4/letter/o/839c29/32.png) [@Osiris](https://community.letsencrypt.org/u/Osiris)\
**Post date:** [June 11, 2021, 4:16pm UTC](https://community.letsencrypt.org/t/unable-to-generate-certificate-on-apache/153614/4 "2021-06-11T16:16:52Z")

</div>

> [@rg305](#):
>
> They don't both work:

IPv6 works for me, I'm getting a tiny HTML placeholder with `<title>This domain is brand new</title>`. IPv4 returns, through the same 302 header you're getting, a login screen.

---

<div class="post-metadata">

**Author:** ![johnvb](https://avatars.discourse-cdn.com/v4/letter/j/d9b06d/32.png) [@johnvb](https://community.letsencrypt.org/u/johnvb)\
**Post date:** [June 11, 2021, 5:35pm UTC](https://community.letsencrypt.org/t/unable-to-generate-certificate-on-apache/153614/5 "2021-06-11T17:35:42Z")

</div>

Thanks for the replies. This is a new domain and I suspect the AAAA records have not been set up for IPv6. I'll try and get that sorted before trying again.

---

<div class="post-metadata">

**Author:** ![johnvb](https://avatars.discourse-cdn.com/v4/letter/j/d9b06d/32.png) [@johnvb](https://community.letsencrypt.org/u/johnvb)\
**Post date:** [June 12, 2021, 9:14am UTC](https://community.letsencrypt.org/t/unable-to-generate-certificate-on-apache/153614/6 "2021-06-12T09:14:14Z")

</div>

Reporting back for the benefit of anyone who comes across this topic. The web hosts who'd set up the domain DNS had created AAAA records, but filled them in correctly. The dry run works now I've corrected that.

Thanks again.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/letsencrypt/original/3X/c/a/ca6c06ea1ea201324bba7048c6841ce60236468d.png) [@system](https://community.letsencrypt.org/u/system)\
**Post date:** [July 12, 2021, 9:14am UTC](https://community.letsencrypt.org/t/unable-to-generate-certificate-on-apache/153614/7 "2021-07-12T09:14:26Z")

</div>

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