Cert-bot failing when trying to renew certificate,

I just created a media wiki site for some folks in my community. I’m not experienced with these tools, I’m a python programmer who knows some SQL, no idea about PHP, webservers or any of this other stuff. Somehow I have managed to get the site up and running, but in the months I’ve been working on it the security certification has gone rotten.
From what I’ve read, it seems like maybe I have more than one application trying to listen/write to the same port (80), but I don’t know.
Everything is running from a gcp box which was clean when I started this project, I’ve got root access to that. My friend did some things with a DNS(?) thing, I don’t know what it was, but I think that’s how it got its domain name. I don’t have access to that right now, but I can ping her if something needs to be done there.
Can someone help me get this website secured?

My domain is:
folkin-wiki.krappenfest.com

I ran this command:
sudo certbot --apache -d folkin-wiki.krappenfest.com

It produced this output:

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/certbot/error_handler.py", line 108, in _call_registered
    self.funcs[-1]()
  File "/usr/lib/python3/dist-packages/certbot/auth_handler.py", line 323, in _cleanup_challenges
    self.auth.cleanup(achalls)
  File "/usr/lib/python3/dist-packages/certbot_apache/configurator.py", line 2312, in cleanup
    self.restart()
  File "/usr/lib/python3/dist-packages/certbot_apache/configurator.py", line 2175, in restart
    self._reload()
  File "/usr/lib/python3/dist-packages/certbot_apache/configurator.py", line 2203, in _reload
    raise errors.MisconfigurationError(error)
certbot.errors.MisconfigurationError: 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 [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs

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 [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs

My web server is (include version):
I don’t know, apache2???

The operating system my web server runs on is (include version):
Ubuntu 18.04.4

My hosting provider, if applicable, is:
I don’t know

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):
I don’t know

1 Like

In this case, you might have other web server running.
What’s the output of netstat -tulpn | grep LISTEN? (Run it with sudo access)

Thank you

tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      6720/nginx: master  
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      19206/systemd-resol 
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1450/sshd           
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      12928/master        
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      6720/nginx: master  
tcp6       0      0 :::80                   :::*                    LISTEN      6720/nginx: master  
tcp6       0      0 :::22                   :::*                    LISTEN      1450/sshd           
tcp6       0      0 :::443                  :::*                    LISTEN      6720/nginx: master  ```
1 Like

Hi,

It seems like you are using Nginx than Apache.
Please try to run sudo certbot --nginx -d folkin-wiki.krappenfest.com.

Thank you

1 Like

Well, I’m pretty embarrassed by that mistake. Thank you so much for your help! Everything seems to be working now.

2 Likes

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