FreeBSD: sudden failures to start Apache

Thank you. This helped, to a degree. Apparently, certbot started to modify my files in a way that is incompatible with my apache setup: instead of copying all the domains again and again, I created a macro (shortened to just the HTTP port):

<Macro VHost $domain $docdir $aliases $maindomain>
	<VirtualHost *:80>
		Use VHostSettings "$domain" "$docdir" "$aliases" "$maindomain"
	</VirtualHost>
</Macro>

Certbot replaces that with:

<Macro VHost $domain $docdir $aliases $maindomain>
	<VirtualHost *:80>
		Include /usr/local/etc/apache24/le_http_01_challenge_pre.conf
Use VHostSettings "$domain""$docdir""$aliases""$maindomain"
Include /usr/local/etc/apache24/le_http_01_challenge_post.conf
	</VirtualHost>
</Macro>

which obviously doesn't work because of the missing spaces on the Use VHostSettings line. When I added them back, everything started to work and I got the new certificates, which prevents me from debugging the issue further. I expect I will need to return to it in two weeks.

The question is, what would be the best way of solving this issue? I would prefer if I didn't have to remove the macro. I am thinking of adding the contents of le_http_01_challenge_pre.conf and le_http_01_challenge_post.conf manually, it doesn't seem like it would be harmful for the server, but how do I prevent certbot from adding the same thing again when run? Should I report an issue? It seems like a bug when certbot removes spaces from my virtual host definitions...

1 Like