LukeSmithxyz / emailwiz

Script that installs/configures a Dovecot, Postfix, Spam Assassin, OpenDKIM Debian web server
GNU General Public License v3.0
1.82k stars 301 forks source link

certbot fails if port is already in use #306

Open Austin-Olacsi opened 10 months ago

Austin-Olacsi commented 10 months ago

certbot fails if port 80 is already in use by another program (certbot uses this port for its temporary web server).

My suggestion is that we modify this script to kill any processes using this port before running certbot.

I am using sudo lsof -i :80 to check if any programs are using this port.

sokkoban commented 7 months ago

You not need to kill any process The Certbot Nginx plugin works by interfacing directly with Nginx to temporarily modify its configuration to serve the required challenge files. This allows Certbot to renew certificates without stopping Nginx or conflicting with its use of port 80.

Just edit your cronjob => 0 /12 root test -x /usr/bin/certbot -a ! -d /run/systemd/system && perl -e 'sleep int(rand(43200))' && certbot -q renew --nginx Test cron = certbot renew --nginx --dry-run