File: config-wsgi.rst

package info (click to toggle)
murano 1%3A6.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 10,644 kB
  • sloc: python: 34,127; sh: 717; pascal: 269; makefile: 83
file content (112 lines) | stat: -rw-r--r-- 2,669 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
Installing Murano API via WSGI
==============================

This document is a guide to deploy murano using two WSGI mode uwsgi and
mod_wsgi of Apache.

Please note that if you intend to use mode uwsgi, you should install
``mode_proxy_uwsgi`` module. For example on deb-base system:

.. code-block:: console

    # sudo apt-get install libapache2-mod-proxy-uwsgi
    # sudo a2enmod proxy
    # sudo a2enmod proxy_uwsgi

.. end

WSGI Application
----------------

The function ``murano.httpd.init_application`` will setup a WSGI application
to run behind uwsgi and mod_wsgi

Murano API behind uwsgi
-----------------------

Create a ``murano-api-uwsgi`` file with content below:

.. code-block:: ini

    [uwsgi]
    chmod-socket = 666
    socket = /var/run/uwsgi/murano-wsgi-api.socket
    lazy-apps = true
    add-header = Connection: close
    buffer-size = 65535
    hook-master-start = unix_signal:15 gracefully_kill_them_all
    thunder-lock = true
    plugins = python
    enable-threads = true
    worker-reload-mercy = 90
    exit-on-reload = false
    die-on-term = true
    master = true
    processes = 2
    wsgi-file = <path-to-murano-bin-dir>/murano-wsgi-api

.. end

Start murano-api:

.. code-block:: console

    # uwsgi --ini /etc/murano/murano-api-uwsgi.ini

.. end

Murano API behind mod_wsgi
--------------------------

Create ``/etc/apache2/murano.conf`` with content below:

.. code-block:: ini

    Listen 8082

    <VirtualHost *:8082>
        WSGIDaemonProcess murano-api processes=1 threads=10 user=%USER% display-name=%{GROUP} %VIRTUALENV%
        WSGIProcessGroup murano-api
        WSGIScriptAlias / %MURANO_BIN_DIR%/murano-wsgi-api
        WSGIApplicationGroup %{GLOBAL}
        WSGIPassAuthorization On
        AllowEncodedSlashes On
        <IfVersion >= 2.4>
          ErrorLogFormat "%{cu}t %M"
        </IfVersion>
        ErrorLog /var/log/%APACHE_NAME%/murano_api.log
        CustomLog /var/log/%APACHE_NAME%/murano_api_access.log combined

        <Directory %MURANO_BIN_DIR%>
            <IfVersion >= 2.4>
                Require all granted
            </IfVersion>
            <IfVersion < 2.4>
                Order allow,deny
                Allow from all
            </IfVersion>
        </Directory>
    </VirtualHost>

.. end

Then on deb-based systems copy or symlink the file to ``/etc/apache2/sites-available``.
For rpm-based systems the file will go in ``/etc/httpd/conf.d``.

Enable the murano site. On deb-based systems:

.. code-block:: console

    # a2ensite murano
    # systemctl reload apache2.service

.. end

On rpm-based systems:

.. code-block:: console

    # systemctl reload httpd.service

.. end