Can't find the acme challenge

My domain is:

armor-computers.com

I ran this command:

sudo certbot --apache

It produced this output:

Which names would you like to activate HTTPS for?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: armor-computers.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 1
Requesting a certificate for armor-computers.com

Certbot failed to authenticate some domains (authenticator: apache). The Certificate Authority reported these problems:
  Domain: armor-computers.com
  Type:   unauthorized
  Detail: 2600:3c00::f03c:93ff:fe37:3e51: Invalid response from http://armor-computers.com/.well-known/acme-challenge/pMm9Gybp4M1Vlaxb-q3IneQiD-TyXBq2ChoYOLZwBqs: 404

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.

Some challenges have failed.
Ask for help or search for solutions at 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):

Server version: Apache/2.4.41 (Ubuntu)
Server built:   2022-06-14T13:30:55

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

Ubuntu 20.04.3 LTS

My hosting provider, if applicable, is:

Linode

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

Hi @malonnnn, and welcome to the LE Community forum :slight_smile:

Let's verify the IP addresses, with:
curl -4 ifconfig.co
curl -6 ifconfig.co

The IPs need to match:

Name:      armor-computers.com
Addresses: 2600:3c00::f03c:93ff:fe37:3e51
           173.255.194.231

Then let's review the output of:
apachectl -t -D DUMP_VHOSTS

4 Likes
armorcom@localhost:~$ curl -4 ifconfig.co
173.255.194.231
armorcom@localhost:~$ curl -6 ifconfig.co
2600:3c00::f03c:93ff:fe37:3e51
armorcom@localhost:~$ apachectl -t -D DUMP_VHOSTS
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using ::1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:443                  armor-computers.com (/etc/apache2/sites-enabled/000-default-le-ssl.conf:2)
*:80                   ::1 (/etc/apache2/sites-enabled/000-default.conf:1)

Please show this file:

4 Likes
<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/html

        # 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
RewriteEngine off
RewriteCond %{SERVER_NAME} =armor-computers.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

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

That file doesn't seem to be in use.
I don't see any such redirection being served:

curl -Ii6 armor-computers.com
HTTP/1.1 200 OK
Date: Tue, 19 Jul 2022 17:40:09 GMT
Server: Apache/2.4.41 (Ubuntu)
Last-Modified: Tue, 19 Jul 2022 04:28:57 GMT
ETag: "94be-5e420ec3c4938"
Accept-Ranges: bytes
Content-Length: 38078
Vary: Accept-Encoding
Content-Type: text/html

curl -Ii4 armor-computers.com
HTTP/1.1 200 OK
Date: Tue, 19 Jul 2022 17:40:14 GMT
Server: Apache/2.4.41 (Ubuntu)
Last-Modified: Tue, 19 Jul 2022 04:28:57 GMT
ETag: "94be-5e420ec3c4938"
Accept-Ranges: bytes
Content-Length: 38078
Vary: Accept-Encoding
Content-Type: text/html

Is there any other possible device inline that might be terminating the HTTP connections?

3 Likes

Not that I know of.
It's a bare ubuntu installation with apache installed.
the site is accessible on port 80, so connections aren't being terminated as far as I can tell.
I do run UFW/iptables but required ports have been punched thru

I think we have two different meanings for "termination".
In this context, it means "where the connection ends" [like the last train stop] - not terminate as killed [like a firewall blocking/stopping it].

So "where" do the HTTP connections get handled?

4 Likes

Maybe there are old/stale Apache services still running ? ? ?
Have you rebooted the server recently?
Please show:
ps -ef | grep pache | grep -v grep

3 Likes

I feel really stupid for saying this, but I don't really understand the question.

The server is apache2 running on a VPS from linode.com
The actual physical location of the datacenter its hosted is Dallas, Texas.
All http requests are handled by apache2 only.

Is that what you're asking?

Could this be one of those weird Apache things? Port 80 looks like an IP based VirtualHost. Maybe the built-in Apache server is being used instead? I can mostly reproduce but not quite so could be wrong.

Should try adding ServerName to 000-default-conf. Rerun the -t -D DUMP_VHOSTS after and try again

ServerName armor-computers.com
3 Likes

Let me restate:

The file you showed has a redirection when the servername is "armor-computers.com"
I showed how when I accessed that name (via IPv4 and IPv6) no such redirection was being offered to me.

So........
What does that mean?

  1. We aren't looking at the current code
  2. We aren't looking in the right server
  3. some other anomaly has occurred
3 Likes

I just fully rebooted the server via

sudo shutdown -r now

and then I grep'd the running apache processes and tried another certbot --apache

Last login: Tue Jul 19 15:51:10 2022 from 173.21.213.149
armorcom@localhost:~$ ps -ef | grep pache | grep -v grep
root         661       1  2 18:04 ?        00:00:00 /usr/sbin/apache2 -k start
www-data     813     661  0 18:04 ?        00:00:00 /usr/sbin/apache2 -k start
www-data     814     661  0 18:04 ?        00:00:00 /usr/sbin/apache2 -k start
www-data     816     661  0 18:04 ?        00:00:00 /usr/sbin/apache2 -k start
www-data     817     661  0 18:04 ?        00:00:00 /usr/sbin/apache2 -k start
www-data     818     661  0 18:04 ?        00:00:00 /usr/sbin/apache2 -k start
armorcom@localhost:~$ sudo certbot --apache
[sudo] password for armorcom:
Saving debug log to /var/log/letsencrypt/letsencrypt.log

Which names would you like to activate HTTPS for?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: armor-computers.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 1
Requesting a certificate for armor-computers.com

Certbot failed to authenticate some domains (authenticator: apache). The Certificate Authority reported these problems:
  Domain: armor-computers.com
  Type:   unauthorized
  Detail: 2600:3c00::f03c:93ff:fe37:3e51: Invalid response from http://armor-computers.com/.well-known/acme-challenge/kxWjvxpkz9zvW0Dm8ccrzsXGp6jryx3dHDGC-tqkPfM: 404

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.

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

I'd do:
ServerName _

4 Likes

Please stop doing that - it's sill broken
The ps output looks good - one single PID (661) running.

If you need to "test", then do:
sudo certbot --apache --dry-run

3 Likes

sorry, I won't run certbot --apache again

armorcom@localhost:~$ apachectl -t -D DUMP_VHOSTS
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using ::1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:443                  armor-computers.com (/etc/apache2/sites-enabled/000-default-le-ssl.conf:2)
*:80                   ::1 (/etc/apache2/sites-enabled/000-default.conf:1)
1 Like

Well... not never [just wait until all is fixed first]

3 Likes

Let's try changing that file (as per @MikeMcQ recommendation and some of my own) to:

<VirtualHost *:80>
        ServerName _
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine off
RewriteCond %{SERVER_NAME} =armor-computers.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
4 Likes

Okay, I updated the file with your condensed version above
Then I restarted the apache service
then dumped the vhosts again

armorcom@localhost:~$ sudo vim /etc/apache2/sites-enabled/000-default.conf
armorcom@localhost:~$ sudo service apache2 restart
armorcom@localhost:~$ apachectl -t -D DUMP_VHOSTS
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using ::1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:443                  armor-computers.com (/etc/apache2/sites-enabled/000-default-le-ssl.conf:2)
*:80                   _ (/etc/apache2/sites-enabled/000-default.conf:1)
1 Like

hmm...
I'm still NOT seeing the redirection.
O M G (my beer goggles are fogged up) !

OK change:
RewriteEngine off
to
RewriteEngine on

4 Likes