ports.conf changed by certbot

Viewed 549

I have two http servers running:

  • nginx (80/443)
  • apache2 (8080/8081)

My ports.conf (apache2) looks like this:

Listen 8080
<IfModule ssl_module>
        Listen 8081
</IfModule>
<IfModule mod_gnutls.c>
        Listen 8081
</IfModule>

Usually both (nginx & apache) run in parallel which is no problem. Periodically certbot from letsencrypt runs (dunno why, it's not listend in crontab) and appends the following lines to the above-mentioned file:

#vim: syntax=apache ts=4 sw=4 sts=4 sr noet
<IfModule mod_ssl.c>
Listen 443
</IfModule>

Apache2 then tries to restart, but fails, because port 443 is already in use by nginx. I tried to delete or comment the new lines, but they get overwritten each time certbot runs. Also changing the port from 443 to 8081 lead to the same result.

I have written a wrapper script that stops nginx, resets apache ports to defaults, updates the certificates and changes them back.

Is it possible to prevent certbot from running automatically? Instead I would like to add my wrapper script to the crontab.

1 Answers
Related