wu.chunyang 303998e294 Switch trove-api to wsgi running under apache.
This change also adds support for Trove backend TLS.

Depends-On: https://review.opendev.org/c/openstack/kolla/+/854744
Change-Id: I2acf7820b24b112b57b0c00a01f5c4b8cb85ce25
2023-02-02 01:22:59 +00:00

44 lines
1.5 KiB
Django/Jinja

{% set wsgi_directory = '/var/lib/kolla/venv/bin' %}
{% if trove_enable_tls_backend | bool %}
{% if kolla_base_distro in ['centos'] %}
LoadModule ssl_module /usr/lib64/httpd/modules/mod_ssl.so
{% else %}
LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so
{% endif %}
{% endif %}
Listen {{ api_interface_address | put_address_in_context('url') }}:{{ trove_api_listen_port }}
ServerSignature Off
ServerTokens Prod
TraceEnable off
TimeOut {{ kolla_httpd_timeout }}
KeepAliveTimeout {{ kolla_httpd_keep_alive }}
{% if trove_logging_debug | bool %}
LogLevel info
{% endif %}
<VirtualHost *:{{ trove_api_listen_port }}>
WSGIDaemonProcess trove-api processes={{ trove_api_workers }} threads=1 user=trove group=trove display-name=trove-api
WSGIProcessGroup trove-api
WSGIScriptAlias / {{ wsgi_directory }}/trove-wsgi
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
<IfVersion >= 2.4>
ErrorLogFormat "%{cu}t %M"
</IfVersion>
ErrorLog /var/log/kolla/trove/trove-api-error.log
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b %D \"%{Referer}i\" \"%{User-Agent}i\"" logformat
CustomLog /var/log/kolla/trove/trove-api-access.log logformat
<Directory {{ wsgi_directory }}>
<Files trove-wsgi>
Require all granted
</Files>
</Directory>
{% if trove_enable_tls_backend | bool %}
SSLEngine On
SSLCertificateFile /etc/trove/certs/trove-cert.pem
SSLCertificateKeyFile /etc/trove/certs/trove-key.pem
{% endif %}
</VirtualHost>