Certbot - Failed authorization procedure. - 404

My domain is: xgn-gaming.com

I ran this command: certbot --authenticator webroot --installer apache --staging --break-my-certs

It produced this output:

Waiting for verification...
Cleaning up challenges
Failed authorization procedure. www.xgn-gaming.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://www.xgn-gaming.com/.well-known/acme-challenge/3Z6iUyPGeZINFraGjbrmL-B2daOMQ8LzgxrIQ9_6c8I: "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p", xgn-gaming.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://xgn-gaming.com/.well-known/acme-challenge/i2suplNLy_yu9OKFe3e2R-h8rIKM4829g12lgW9kJyo: "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p"

IMPORTANT NOTES:
 - The following errors were reported by the server:

   Domain: www.xgn-gaming.com
   Type:   unauthorized
   Detail: Invalid response from
   http://www.xgn-gaming.com/.well-known/acme-challenge/3Z6iUyPGeZINFraGjbrmL-B2daOMQ8LzgxrIQ9_6c8I:
   "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
   <html><head>
   <title>404 Not Found</title>
   </head><body>
   <h1>Not Found</h1>
   <p"

   Domain: xgn-gaming.com
   Type:   unauthorized
   Detail: Invalid response from
   http://xgn-gaming.com/.well-known/acme-challenge/i2suplNLy_yu9OKFe3e2R-h8rIKM4829g12lgW9kJyo:
   "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
   <html><head>
   <title>404 Not Found</title>
   </head><body>
   <h1>Not Found</h1>
   <p"

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A/AAAA record(s) for that domain
   contain(s) the right IP address.

My web server is (include version): Server version: Apache/2.4.18 (Ubuntu)

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

My hosting provider, if applicable, is: Self hosted

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): ISPConfig 3 is installed

Additional info:

First I made sure the DNS records are correct. Next I made sure the domain is working. I’ve also made sure http://xgn-gaming.com/.well-known/acme-challenge works. (Will return a 403 if you try to access it now).

When performing the command, the .well-known directory is correctly created and inmediately emptied after the fail. At this point, I’m completely lost at what else I can do?

How did you specify the webroot directory? Can you manually place files there and see them appear in the corresponding locations on your web site?

I specified the root as: /var/www/xgn-gaming.com/web
Yes, I can place files there and they appear on the site. Proof: http://xgn-gaming.com/test.txt

Here’s also a screenshot of the console: http://home.icecub.nl/ImageUpload/image.php?id=52&f=image.png

Try /var/www/xgn-gaming.com/web/.well-known/acme-challenge/test.txt if that is working.

The dot at the beginning of .well-known trips up some configurations.

You’re right. The file is there, but it doesn’t work when I try to visit it.

Thanks for the help everyone. After applying the following configuration, my issue was solved and the certificate was applied succesfully:

Alias /.well-known/acme-challenge/ /var/www/xgn-gaming.com/web/.well-known/acme-challenge/
<Directory "/var/www/xgn-gaming.com/web/.well-known/acme-challenge/">
    Options None
    AllowOverride None
    ForceType text/plain
    RedirectMatch 404 "^(?!/\.well-known/acme-challenge/[\w-]{43}$)"
</Directory>

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