Certbot 1.20.0 cert creation fails with a 404, even though the site is available on port 80

I've searched high and low for the same error and although I have seen others with the same error, none of the fixes have worked for me. I am using the current version of httpd/apache2 from homebrew, not the default apache2 version supplied with macOS. I'm guessing it is an issue with my apache setup. I've read previously that this is not the error message you get when it is a permissions issue, but who knows. Any help/insight is greatly appreciated!

My domain is: tetraicosa.com

I ran this command: sudo certbot --apache

It produced this output:

Certbot failed to authenticate some domains (authenticator: apache). The Certificate Authority reported these problems:
Domain: tetraicosa.com
Type: unauthorized
Detail: Invalid response from http://tetraicosa.com/.well-known/acme-challenge/d8HsQsONsc_Xd0ejelqN7pIC0krV6IcFlDG-Duklbgk [X.X.X.X]: "\n\n404 Not Found\n\n

Not Found

\n<p"

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.

It is accessible from the internet. In addition, I have no AAAA record, so IPv6 shouldn't be an issue.

My web server is (include version): Server version: Apache/2.4.51 (Unix)

The operating system my web server runs on is (include version): macOS Big Sur version 11.6

My hosting provider, if applicable, is: N/A

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

2 Likes

Welcome Back to the Let's Encrypt Community :slightly_smiling_face:

What is the output of:

sudo apachectl -S

Please put 3 backticks above and below the output, like this:

```
output
```

3 Likes
ServerRoot: "/opt/homebrew/opt/httpd"
Main DocumentRoot: "/opt/homebrew/var/www/tetraicosa"
Main ErrorLog: "/opt/homebrew/var/log/httpd/error_log"
Mutex mpm-accept: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex ssl-stapling: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/opt/homebrew/var/run/httpd/" mechanism=default
PidFile: "/opt/homebrew/var/run/httpd/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="_www" id=70
Group: name="_www" id=70```
2 Likes

And thanks for the welcome back, been a while! :slight_smile:

3 Likes

You are quite welcome. :blush:

3 Likes

What is the output of:

sudo ls -lRa /opt/homebrew/opt/httpd
3 Likes

lrwxr-xr-x 1 htpc admin 22 Oct 30 21:55 /opt/homebrew/opt/httpd -> ../Cellar/httpd/2.4.51

2 Likes

updated

1 Like

I failed on the copy pasta :expressionless:

2 Likes

That looks like a relative symbolic link with the two dots. I would think it would be difficult to find your Apache installation like that.

3 Likes

It's for sure a symlink. I didn't create it.

2 Likes

Try remapping the symbolic link to be absolute (starting with a forward slash, so no dots in front). You'll need to figure out where the "Cellar" directory is located.

3 Likes

One sec

1 Like

Be sure to use the correct username/sudo.

3 Likes

Shouldn't homebrew handle this by default?

3 Likes

I would think so. Let's assume that and just dig a bit. Don't worry about the symlink for now.

2 Likes

one sec

1 Like

What is the output of:

sudo ls -lRa /opt/homebrew

This might be rather large...

3 Likes

sorry so slow, popping in and out using any desk.

2 Likes

You want me to pastebin it?

2 Likes