Help, accidentally deleted the letsencrypt and certbot directory

I have a valid certificate for apache until February 25th.
I accidentally deleted the directory etc/letsencrypt,
in this directory was certbot and certificate.

I installed again certbot and letsencrypt repository.
when trying to get a new certificate error:

Error while running apache2ctl configtest.
Action ‘configtest’ failed.
The Apache error log may have more information.

apache2: Syntax error on line 219 of /etc/apache2/apache2.conf: Syntax error on line 33 of /etc/apache2/sites-enabled/000-default-le-ssl.conf: Could not open co nfiguration file /etc/letsencrypt/options-ssl-apache.conf: No such file or directory.

what to do?
how to get a new certificate?

If you cannot get the /etc/letsencrypt/ directory back (you did make regular backups, right?), you'll need to delete the /etc/apache2/sites-enabled/000-default-le-ssl.conf file before you can run certbot again. If there are any other files in sites-enabled ending on -le-ssl.conf, you probably need to delete those too.

no backup, deleted now /etc/apache2/sites-enabled/000-default-le-ssl.conf
start issuing a new certificate turned out, but at the end an error
Error while running apache2ctl graceful.
httpd not running, trying to start
Action ‘graceful’ failed.
The Apache error log may have more information.

(98)Address already in use: AH00072: make_sock: could not bind to address [::]:443
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:443
no listening sockets available, shutting down
AH00015: Unable to open logs

This looks like certbot is trying to run in standalone mode.
Or the apache2ctl was unable to stop apache, then gripes when trying to start it.
[because it was already running - never shutdown]

Make sure you run certbot with root privileges.
Also. I would manually stop then start apache before continuing.
[to insure it is responding correctly to such commands]

Or.. you have multiple web servers [each fighting for port 443]
Check who has what with:
netstat -pant | grep -i listen

stopping apache2 didn’t help, ran a command:
sudo /etc/init.d/apache2 stop

interfere with the launch of nginx on port 443? right?

Yes, it seem both Apache and NGINX are trying to use port 443.
You need to pick one and disable the others’ use of port 443.

How to remove nginx from port 443

The easiest way is to change the listening ports in the file:
/etc/nginx/nginx.conf
[then restart nginx]

But you may also have other listen statements, so try finding all of them with:
grep -Eri 'listen|443' /etc/nginx

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