Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

certbot fails if port is already in use #306

Open
Austin-Olacsi opened this issue Dec 30, 2023 · 1 comment
Open

certbot fails if port is already in use #306

Austin-Olacsi opened this issue Dec 30, 2023 · 1 comment

Comments

@Austin-Olacsi
Copy link

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
Copy link

sokkoban commented Apr 1, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants