Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. crt.sh | example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.
My domain is: bilmuh.gtu.edu.tr
I ran this command: certbot --apache -d bilmuh.gtu.edu.tr
It produced this output:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Error while running apachectl configtest.
AH00526: Syntax error on line 16 of /etc/httpd/conf.d/hcilab-le-ssl.conf:
SSLCertificateFile: file '/etc/letsencrypt/live/hcilab.gtu.edu.tr/cert.pem' does not exist or is empty
The apache plugin is not working; there may be problems with your existing configuration.
The error was: MisconfigurationError("Error while running apachectl configtest.\n\nAH00526: Syntax error on line 16 of /etc/httpd/conf.d/hcilab-le-ssl.conf:\nSSLCertificateFile: file '/etc/letsencrypt/live/hcilab.gtu.edu.tr/cert.pem' does not exist or is empty\n",)
[root@bilmuh bilmuh]# systemctl restart httpd
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
I deleted the letsencrypt folder from the file manager. so httpd doesn't work either.
the error it gives:
Jan 05 17:18:28 bilmuh.gtu.edu.tr systemd[1]: Starting The Apache HTTP Server...
Jan 05 17:18:28 bilmuh.gtu.edu.tr httpd[1195]: AH00112: Warning: DocumentRoot [/home/bilmuh/www/] does not exist
Jan 05 17:18:28 bilmuh.gtu.edu.tr httpd[1195]: AH00526: Syntax error on line 16 of /etc/httpd/conf.d/hcilab-le-ssl.conf:
Jan 05 17:18:28 bilmuh.gtu.edu.tr httpd[1195]: SSLCertificateFile: file '/etc/letsencrypt/live/bilmuh.gtu.edu.tr/cert.pem' does not exist or is empty
Jan 05 17:18:28 bilmuh.gtu.edu.tr systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jan 05 17:18:28 bilmuh.gtu.edu.tr systemd[1]: Failed to start The Apache HTTP Server.
Jan 05 17:18:28 bilmuh.gtu.edu.tr systemd[1]: Unit httpd.service entered failed state.
Jan 05 17:18:28 bilmuh.gtu.edu.tr systemd[1]: httpd.service failed.
Actually, there was an SSL certificate at bilmuh.gtu.edu.tr. Later, when I added certificates to subdomains, it got confused like this.
How can I completely delete letsencrypt and reinstall it.
You already removed the entire letsencrypt folder, why would you want to "entirely delete letsencrypt and reinstall it"?
It seems you don't fully grasp how Certbot works. Let me explain:
Certbot is a Python application originally developed by Let's Encrypt, but somewhere in 2016, development was transfered to the Electronic Frontier Foundation.
The Certbot program was once called "letsencrypt".
Due to the above, the data directory generated by Certbot is /etc/letsencrypt/.
But the Certbot program is located elsewhere.
Reinstalling Certbot does not magically bring back the /etc/letsencrypt/ directory.
Your Apache webserver is expecting the files from /etc/letsencrypt/.
There are three possible solution and deleting Certbot and reinstalling it is not one of them:
Temporarily disable the HTTPS configuration file for 'bilmuh.gtu.edu.trfound here:/etc/httpd/conf.d/hcilab-le-ssl.conf. If you didn't generate that configuration file yourself, but Certbot generated it based on your HTTP configuration *and* you didn't modify it manually, you could make a backup of the file and after the backup step delete it from /etc/httpd/conf.d/`. However, this would make your site HTTP only for the time until you generate your new certificate. Could be an issue if you have HTST configured.
Generate a self-signed certificate as "snake oil" and configure your HTTPS site so it temporarily uses this self-signed certificate. Afterwards, use Certbot to get a certificate and it should update the configuration file again.
Stop Apache and use the standalone plugin to get a new certificate. However, transition from the standalone plugin back to the apache plugin is not something I've done personally, so we should figure that out once your site is back up again.
Hopefully your current predicament has learned you not to delete directories without a backup if you don't know exactly what you're doing.
Now I have the information, thank you very much, I struggled a bit, this is the last situation:
[root@bilmuh bilmuh]# certbot --apache -d bilmuh.gtu.edu.tr
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org
Requesting a certificate for bilmuh.gtu.edu.tr
Performing the following challenges:
http-01 challenge for bilmuh.gtu.edu.tr
Error while running apachectl configtest.
AH00526: Syntax error on line 216 of /etc/httpd/conf.d/ssl.conf:
SSLCertificateFile: file '/etc/letsencrypt/live/bilmuh.gtu.edu.tr/cert.pem' does not exist or is empty
Cleaning up challenges
Error while running apachectl configtest.
AH00526: Syntax error on line 216 of /etc/httpd/conf.d/ssl.conf:
SSLCertificateFile: file '/etc/letsencrypt/live/bilmuh.gtu.edu.tr/cert.pem' does not exist or is empty