diff --git a/actions/apache b/actions/apache index a888acac9..6b64c95c6 100755 --- a/actions/apache +++ b/actions/apache @@ -7,6 +7,7 @@ Configuration helper for Apache web server. import argparse import glob +import os import re import subprocess @@ -97,6 +98,11 @@ def subcommand_setup(arguments): subprocess.run([ 'make-ssl-cert', 'generate-default-snakeoil', '--force-overwrite' ], check=True) + # In case the certificate has been removed after ssl-cert is installed + # on a fresh Debian machine. + elif not os.path.exists('/etc/ssl/certs/ssl-cert-snakeoil.pem'): + subprocess.run(['make-ssl-cert', 'generate-default-snakeoil'], + check=True) with action_utils.WebserverChange() as webserver: # Disable mod_php as we have switched to mod_fcgi + php-fpm. Disable