diff --git a/placement/templates/bin/_placement-api.sh.tpl b/placement/templates/bin/_placement-api.sh.tpl index 5cd89188d5..7c5acb35d1 100644 --- a/placement/templates/bin/_placement-api.sh.tpl +++ b/placement/templates/bin/_placement-api.sh.tpl @@ -24,19 +24,32 @@ function start () { cp -a $(type -p placement-api) /var/www/cgi-bin/placement/ if [ -f /etc/apache2/envvars ]; then - # Loading Apache2 ENV variables - source /etc/apache2/envvars + # Loading Apache2 ENV variables + source /etc/apache2/envvars + # The directory below has to be created due to the fact that + # libapache2-mod-wsgi-py3 doesn't create it in contrary by libapache2-mod-wsgi + mkdir -p ${APACHE_RUN_DIR} fi # Get rid of stale pid file if present. rm -f /var/run/apache2/*.pid # Start Apache2 - exec apache2ctl -DFOREGROUND + {{- if .Values.conf.software.apache2.a2enmod }} + {{- range .Values.conf.software.apache2.a2enmod }} + a2enmod {{ . }} + {{- end }} + {{- end }} + {{- if .Values.conf.software.apache2.a2dismod }} + {{- range .Values.conf.software.apache2.a2dismod }} + a2dismod {{ . }} + {{- end }} + {{- end }} + exec {{ .Values.conf.software.apache2.binary }} {{ .Values.conf.software.apache2.start_parameters }} } function stop () { - apache2ctl -k graceful-stop + {{ .Values.conf.software.apache2.binary }} -k graceful-stop } $COMMAND diff --git a/placement/values.yaml b/placement/values.yaml index 1080ab6578..91f589bbbc 100644 --- a/placement/values.yaml +++ b/placement/values.yaml @@ -65,6 +65,18 @@ conf: segregation: 'rule:context_is_admin' admin_or_owner: 'rule:context_is_admin or project_id:%(project_id)s' default: 'rule:admin_or_owner' + software: + apache2: + binary: apache2 + start_parameters: -DFOREGROUND + # Enable/Disable modules + # a2enmod: + # - headers + # - rewrite + # a2dismod: + # - status + a2enmod: null + a2dismod: null placement: DEFAULT: debug: false