Amazon Linux 2, -localhost.crt does not exist- while running -sudo certbot-

Hi everyone

One month ago I tried for first time to install a let’sencrypt cert on one of my domains hosted on AWS (Amazon Linux 2), I just look for a tutorial on google and in a few minutes I get it, but now -one month later- I just try and try and try again and I always get the same error while runing the “sudo certbot” command.

This is the error message
/*
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Error while running apachectl configtest.

AH00526: Syntax error on line 100 of /etc/httpd/conf.d/ssl.conf:
SSLCertificateFile: file ‘/etc/pki/tls/certs/localhost.crt’ does not exist or is empty

Certbot doesn’t know how to automatically configure the web server on this system. However, it can still get a certificate for you. Please run “certbot certonly” to do so. You’ll need to manually configure your web server to use the resulting certificate.
*/

This is the tutorial I’m following

I don’t know If I’m missing something.

Could anyone help me please, Thanks!!!

It indicates that your Apache configuration is broken, so the Certbot Apache plugin can’t perform its duties. If you tried to restart Apache right now, it would fail to come online. Certbot needs a functioning Apache installation.

You can try commenting out the lines that apachectl configtest complains about until Certbot succeeds, but take care that your changes make sense.

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