blob: 892b7ad47dcd0edc00f0f8258d15e25bd0252a1f (
plain)
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
|
Configuring ironic-api behind mod_wsgi
--------------------------------------
Bare Metal service comes with an example file for configuring the
``ironic-api`` service to run behind Apache with mod_wsgi.
#. Install the apache service:
Fedora/RHEL8/CentOS8::
sudo dnf install httpd
Debian/Ubuntu::
apt-get install apache2
SUSE::
zypper install apache2
#. Download the ``etc/apache2/ironic`` file from the
`Ironic project tree <https://opendev.org/openstack/ironic/raw/branch/master/etc/apache2/ironic>`_
and copy it to the apache sites:
Fedora/RHEL8/CentOS8::
sudo cp etc/apache2/ironic /etc/httpd/conf.d/ironic.conf
Debian/Ubuntu::
sudo cp etc/apache2/ironic /etc/apache2/sites-available/ironic.conf
SUSE::
sudo cp etc/apache2/ironic /etc/apache2/vhosts.d/ironic.conf
#. Edit the recently copied ``<apache-configuration-dir>/ironic.conf``:
#. Modify the ``WSGIDaemonProcess``, ``APACHE_RUN_USER`` and
``APACHE_RUN_GROUP`` directives to set the user and group values to
an appropriate user on your server.
#. Modify the ``WSGIScriptAlias`` directive to point to the automatically
generated ``ironic-api-wsgi`` script that is located in `IRONIC_BIN`
directory.
#. Modify the ``Directory`` directive to set the path to the Ironic API code.
#. Modify the ``ErrorLog`` and ``CustomLog`` to redirect the logs
to the right directory (on Red Hat systems this is usually under
/var/log/httpd).
#. Stop and disable the ironic-api service. If ironic-api service is
started, the port will be occupied. Apach will fail to start:
Fedora/RHEL8/CentOS8/SUSE::
sudo systemctl stop openstack-ironic-api
sudo systemctl disable openstack-ironic-api
Debian/Ubuntu::
sudo service ironic-api stop
sudo service ironic-api disable
#. Enable the apache ``ironic`` in site and reload:
Fedora/RHEL8/CentOS8::
sudo systemctl reload httpd
Debian/Ubuntu::
sudo a2ensite ironic
sudo service apache2 reload
SUSE::
sudo systemctl reload apache2
.. note::
The file ``ironic-api-wsgi`` is automatically generated by pbr and is
available in `IRONIC_BIN` directory. It should not be modified.
Configure another WSGI container
--------------------------------
A slightly different approach has to be used for WSGI containers that cannot
use ``ironic-api-wsgi``. For example, for *gunicorn*:
.. code-block:: console
gunicorn -b 0.0.0.0:6385 'ironic.api.wsgi:initialize_wsgi_app(argv=[])'
If you want to pass a configuration file, use:
.. code-block:: console
gunicorn -b 0.0.0.0:6385 \
'ironic.api.wsgi:initialize_wsgi_app(argv=["ironic-api", "--config-file=/path/to/_ironic.conf"])'
|