diff --git a/docker/base/httpd_setup.sh b/docker/base/httpd_setup.sh index 990062e6d8..edb1d7df65 100644 --- a/docker/base/httpd_setup.sh +++ b/docker/base/httpd_setup.sh @@ -15,4 +15,13 @@ if [[ "$(whoami)" == 'root' ]]; then else rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd* fi + + # CentOS 8 has an issue with mod_ssl which produces an invalid Apache + # configuration in /etc/httpd/conf.d/ssl.conf. This causes the following error + # on startup: + # SSLCertificateFile: file '/etc/pki/tls/certs/localhost.crt' does not exist or is empty + # Work around this by generating certificates manually. + if [[ ${KOLLA_BASE_DISTRO} = centos ]] && [[ ! -e /etc/pki/tls/certs/localhost.crt ]]; then + /usr/libexec/httpd-ssl-gencerts + fi fi