I have two http servers running:
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.
I had this problem as well. I realized that I had installed the certificate configured to use apache, which was then being proxied by nginx. To solve, I simply created a new certificate for that domain using nginx as the server instead. It no longer tries to configure the port number during it's attempt to renew.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With