Can't generate a certificate for my domain name on Debian 11

Hello, I was trying to generate a SSL certificate for my website but it keeps returning the 404 error, I tried few things that I saw on forums but none seems to work, so I am here requesting help.

My domain is: apoc.sytes.net

I ran this command: sudo certbot --apache

It produced this output: Saving debug log to /var/log/letsencrypt/letsencrypt.log
Please enter the domain name(s) you would like on your certificate (comma and/or space separated) (Enter 'c' to cancel): apoc.sytes.net
Requesting a certificate for apoc.sytes.net

Certbot failed to authenticate some domains (authenticator: apache). The Certificate Authority reported these problems:
Domain: apoc.sytes.net
Type: unauthorized
Detail: 82.64.221.152: Invalid response from http://apoc.sytes.net/.well-known/acme-challenge/-fZVBuUi4TQxELdv52OdVQgsdXGPNSo_dWxHzW1zhJg: 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): Apache/2.4.56 (Debian)

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

My hosting provider, if applicable, is: me

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 2.5.0

1 Like

What's the output from this command:

sudo apachectl -t -D DUMP_VHOSTS
4 Likes

Here is the output :

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.0.200. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:

To use the --apache plug-in you need a VirtualHost for that domain name on port 80.

The --apache plug-in uses that to make temp changes to validate the cert request. It then creates a VirtualHost for port 443 (https) based on the port 80 VHost.

If you don't want to do that, you could try using the --webroot method instead. Then you will have to create your own VirtualHost for HTTPS (port 443).

3 Likes

How do I use it ?

When doing sudo certbot --apache plug-in it gives me : certbot: error: unrecognized arguments: plug-in

That command is the --apache plug-in :slight_smile:

Have you created the VirtualHost for port 80 for that domain name?

https://eff-certbot.readthedocs.io/en/stable/using.html#certbot-command-line-options

3 Likes

Yeah I was using the --apache plug-in

For the Virtual host I don't know, for the moment my website only works on http so I guess it uses the port 80 but I don't know how to know if I have the port 80 VirtualHost

The command to see your vhosts was already provided:

If you don't have any, then they must be created.

3 Likes

How do I do ? I found files online but they don't work...

Sorry, this is not a place to learn how to use Apache.

3 Likes

Here details on Apache can be found in documentation and forums:

3 Likes

And related to the link @MikeMcQ already posted, here are links for plug-in

2 Likes

All it really is is to create a apoc.sytes.net.conf file in /etc/apache2/sites-available/ with this sort of thing:

<VirtualHost *:80>
  ServerName apoc.sytes.net
  DocumentRoot /var/www/html/
</VirtualHost>

That way, your Apache server can have multiple different websites on it. Certbot relies on this kind of structure, which is typical for modern Apache installations.

5 Likes

Also, after doing this for the first time, you should run a2ensite to cause it to be linked in sites-enabled.

3 Likes

That's a free dns provider... I don't think you're allowed or able to create or have an SSL certificate for that.

Just looked at his site... apparently it is OK to have an SSL for free dns address!

It is totally fine, although you may be more likely to run into rate limits that way if a lot of other people are also requesting Let's Encrypt certificates for subdomains of that same shared domain!

4 Likes

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