2.6 KiB
Installing the API via WSGI
This document provides two WSGI methods as examples:
- uWSGI
- Apache
mod_wsgi
The "wsgi.py" file
qinling/api/wsgi.py
file sets up the API WSGI
application, it has to be copied into
/var/www/cgi-bin/qinling
directory.
mkdir -p /var/www/cgi-bin/qinling
cp qinling/api/wsgi.py /var/www/cgi-bin/qinling
chown qinling:qinling -R /var/www/cgi-bin/qinling
Running with Apache and mod_wsgi
The etc/apache2/qinling-api.conf
file contains an
example of Apache virtualhost configured with mod_wsgi
.
../../../etc/apache2/qinling-api.conf
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
.Modify the
WSGIDaemonProcess
directive to set theuser
andgroup
values to an appropriate user on your server. In many installationsqinling
will be correct. Modify theWSGIScriptAlias
directive to set the path of the wsgi script.If you are using a virtualenv
WSGIDaemonProcess
requirespython-path
parameter, the value should be<your-venv-path>/lib/python<your-version>/site-packages
.Enable the
qinling-api
virtualhost.On deb-based systems:
a2ensite qinling-api systemctl reload apache2
On rpm-based systems:
systemctl reload httpd
Running with uWSGI
The etc/uwsgi/qinling-api.yaml
file contains an example
of uWSGI configuration.
Create the
qinling-api.yaml
file.../../../etc/uwsgi/qinling-api.yaml
Then start the uWSGI server:
uwsgi ./qinling-api.yaml
Or start in background with:
uwsgi -d ./qinling-api.yaml