Certbot - Challenge failed for domain / not found

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), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

Dear community,
this question has been asked before . Nevertheless I did not find a solution that would resolve my issues.
Pls see below the information requested, I have added additional information based on what has been requested in other case – maybe this is of help.

I am pretty new to ubuntu so please bear with me

I ran this command:
certbot --apache

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: nextcloudmh.ddns.net


Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel):
Requesting a certificate for nextcloudmh.ddns.net
Performing the following challenges:
http-01 challenge for nextcloudmh.ddns.net
Waiting for verification...
Challenge failed for domain nextcloudmh.ddns.net
http-01 challenge for nextcloudmh.ddns.net
Cleaning up challenges
Some challenges have failed.
IMPORTANT NOTES:

My domain:
nextcloudmh@ddns.net

My web server is (include version):
Server version: Apache/2.4.46 (Ubuntu)
Server built: 2020-08-25T12:13:38

The operating system my web server runs on is (include version):
Distributor ID: Ubuntu
Description: Ubuntu 20.10
Release: 20.10
Codename: groovy

My hosting provider, if applicable, is:
Self-hosting, Raspberry Pi 4 4GB

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.14.0

apachectl -S
VirtualHost configuration:
*:80 is a NameVirtualHost
default server nextcloudmh.ddns.net (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost nextcloudmh.ddns.net (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost nextcloudmh.ddns.net (/etc/apache2/sites-enabled/nextcloud.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex default: dir="/var/run/apache2/" mechanism=default
Mutex mpm-accept: using_defaults
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33

Owner rights /var/www/html (ls -l)
total 12
-rw-r--r-- 1 root root 10918 Apr 14 22:58 index.html

Owner rights /var/www/nextcloud (ls -l)
total 152
drwxr-xr-x 43 www-data www-data 4096 Apr 8 13:32 3rdparty
-rw-r--r-- 1 www-data www-data 17900 Apr 8 13:31 AUTHORS
-rw-r--r-- 1 www-data www-data 34520 Apr 8 13:31 COPYING
drwxr-xr-x 47 www-data www-data 4096 Apr 8 13:32 apps
drwxr-xr-x 2 www-data www-data 4096 Apr 15 17:28 config
-rw-r--r-- 1 www-data www-data 3900 Apr 8 13:31 console.php
drwxr-xr-x 22 www-data www-data 4096 Apr 8 13:32 core
-rw-r--r-- 1 www-data www-data 5122 Apr 8 13:31 cron.php
drwxr-xr-x 2 www-data www-data 4096 Apr 15 20:54 data
-rw-r--r-- 1 www-data www-data 156 Apr 8 13:31 index.html
-rw-r--r-- 1 www-data www-data 2960 Apr 8 13:31 index.php
drwxr-xr-x 6 www-data www-data 4096 Apr 8 13:31 lib
-rw-r--r-- 1 www-data www-data 283 Apr 8 13:31 occ
drwxr-xr-x 2 www-data www-data 4096 Apr 8 13:31 ocm-provider
drwxr-xr-x 2 www-data www-data 4096 Apr 8 13:31 ocs
drwxr-xr-x 2 www-data www-data 4096 Apr 8 13:31 ocs-provider
-rw-r--r-- 1 www-data www-data 3144 Apr 8 13:31 public.php
-rw-r--r-- 1 www-data www-data 5341 Apr 8 13:31 remote.php
drwxr-xr-x 4 www-data www-data 4096 Apr 8 13:31 resources
-rw-r--r-- 1 www-data www-data 26 Apr 8 13:31 robots.txt
-rw-r--r-- 1 www-data www-data 2446 Apr 8 13:31 status.php
drwxr-xr-x 3 www-data www-data 4096 Apr 8 13:31 themes
drwxr-xr-x 2 www-data www-data 4096 Apr 8 13:31 updater
-rw-r--r-- 1 www-data www-data 382 Apr 8 13:32 version.php

dig +noall +answer nextcloudmh.ddns.net
nextcloudmh.ddns.net. 60 IN A 84.73.204.231

I can access the NC webinterface through my external IP address (only http), firewall ufw is inactive
Access through http port 80 w/ internal ip address works
Any support is highly appreciated.
Thanks and best regards,

2 Likes

Welcome to the Let's Encrypt Community :slightly_smiling_face:

What are the contents of these files?

/etc/apache2/sites-enabled/000-default.conf
/etc/apache2/sites-enabled/nextcloud.conf

What are the outputs of these commands?

sudo ls -lRa /etc/apache2/sites-available
sudo ls -lRa /etc/apache2/sites-enabled

Please put three backticks above and below each contents and output like this:

```
stuff
```

2 Likes

There is a name:port conflict shown above.

3 Likes

Thanks for the fast response.
Please see requested information:

Sudo nano /etc/apache2/sites-enabled/000-default.conf
<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/nextcloud

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

```
Nano /etc/apache2/sites-enabled/nextcloud.conf
<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        ServerName nextcloudmh.ddns.net

        ServerAdmin mhcloudadmi@web.de
        DocumentRoot /var/www/nextcloud

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

```
sudo ls -lRa /etc/apache2/sites-available
/etc/apache2/sites-available:
total 24
drwxr-xr-x 2 root root 4096 Apr 15 21:46 .
drwxr-xr-x 8 root root 4096 Apr 15 21:46 ..
-rw-r--r-- 1 root root 1337 Apr 15 17:27 000-default.conf
-rw-r--r-- 1 root root 6338 Mar  5  2020 default-ssl.conf
-rw-r--r-- 1 root root 1340 Apr 15 16:18 nextcloud.conf

```
**sudo ls -lRa /etc/apache2/sites-enabled**

/etc/apache2/sites-enabled:

total 8

drwxr-xr-x 2 root root 4096 Apr 16 08:41 .

drwxr-xr-x 8 root root 4096 Apr 15 21:46 ..

lrwxrwxrwx 1 root root 35 Apr 14 22:58 000-default.conf -> ../sites-available/000-default.conf

lrwxrwxrwx 1 root root 33 Apr 14 23:10 nextcloud.conf -> ../sites-available/nextcloud.conf
```
1 Like

How can I resolve this?

2 Likes

This file:

has no servername, so it will use the default servername used in the main http config - which apparently is the same name ("nextcloudmh.ddns.net").
You can add a default name there or remove/disable this file altogether to clear the duplicate name:port overlap conflict.

2 Likes

That worked, perfect!
Problem solved.

We (or better I) learn everyday.
Thank for your help , much appreciated.

3 Likes

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