kolla/docker/base/httpd_setup.sh
Radosław Piliszek 032804e5a0 Be strict about errors in start
Make start.sh run with pipefail and nounset to avoid common errors
in the start scripts and detect them early.

Httpd code had to be patched to allow it to pass on Debuntu.

Also fix the two missed applications of httpd to make sure all
its path are covered.

And also fix Horizon's ENABLE_ZAQAR - K-A does not use Zaqar.
Yet another - Horizon's settings_bundle. :-)

Finally, fix Neutron for Debuntu (KOLLA_LEGACY_IPTABLES).

Change-Id: I39b8d78f6758df1f92b8b0d2c06ea99b038b843b
Depends-On: https://review.opendev.org/711923
2020-10-05 13:03:39 +02:00

31 lines
1.3 KiB
Bash

#!/bin/bash
# This script performs setup necessary to run the Apache httpd web server.
# It should be sourced rather than executed as environment variables are set.
# Assume the service runs on top of Apache httpd when user is root.
if [[ "$(whoami)" == 'root' ]]; then
# NOTE(pbourke): httpd will not clean up after itself in some cases which
# results in the container not being able to restart. (bug #1489676, 1557036)
if [[ "${KOLLA_BASE_DISTRO}" =~ debian|ubuntu ]]; then
# NOTE(yoctozepto): APACHE_CONFDIR has to be set to pass the next step
# under the `set -o nounset` regime
APACHE_CONFDIR=
# Loading Apache2 ENV variables
. /etc/apache2/envvars
install -d /var/run/apache2/
rm -rf /var/run/apache2/*
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