[GH-ISSUE #116] Support uWSGI #73

Closed
opened 2026-02-26 10:36:00 +03:00 by kerem · 5 comments
Owner

Originally created by @pschiffe on GitHub (Aug 19, 2016).
Original GitHub issue: https://github.com/PowerDNS-Admin/PowerDNS-Admin/issues/116

In production deployments, python web server is usually not facing users. For performance and stability reasons, there is usually an nginx proxy with uWSGI in front of a python app.

Couple of useful links:
https://www.digitalocean.com/community/tutorials/how-to-deploy-python-wsgi-applications-using-uwsgi-web-server-with-nginx
http://flask.pocoo.org/docs/0.11/deploying/uwsgi/

Originally created by @pschiffe on GitHub (Aug 19, 2016). Original GitHub issue: https://github.com/PowerDNS-Admin/PowerDNS-Admin/issues/116 In production deployments, python web server is usually not facing users. For performance and stability reasons, there is usually an nginx proxy with uWSGI in front of a python app. Couple of useful links: https://www.digitalocean.com/community/tutorials/how-to-deploy-python-wsgi-applications-using-uwsgi-web-server-with-nginx http://flask.pocoo.org/docs/0.11/deploying/uwsgi/
kerem closed this issue 2026-02-26 10:36:00 +03:00
Author
Owner

@joachimtingvold commented on GitHub (Aug 19, 2016):

Not sure what this "issue" is for? *WSGI is already supported -- you just have to make the Apache/nginx-configuration yourself (which is a standard WSGI-setup).

Should probably be some examples/instructions/documentation, but the support itself is already there.

<!-- gh-comment-id:241022057 --> @joachimtingvold commented on GitHub (Aug 19, 2016): Not sure what this "issue" is for? *WSGI is already supported -- you just have to make the Apache/nginx-configuration yourself (which is a standard WSGI-setup). Should probably be some examples/instructions/documentation, but the support itself is already there.
Author
Owner

@joachimtingvold commented on GitHub (Aug 19, 2016):

Example setup with Apache 2.4 with mod_wsgi;

<VirtualHost *:443>
        ServerName superawesomedns.foo.bar
        ServerAlias [fe80::1]
        ServerAdmin webmaster@foo.bar

        SSLEngine On
        SSLCertificateFile /some/path/ssl/certs/cert.pem
        SSLCertificateKeyFile /some/path/ssl/private/cert.key

        ErrorLog /var/log/apache2/error-superawesomedns.foo.bar.log
        CustomLog /var/log/apache2/access-superawesomedns.foo.bar.log combined

        DocumentRoot /srv/vhosts/superawesomedns.foo.bar/

        WSGIDaemonProcess pdnsadmin user=pdnsadmin group=pdnsadmin threads=5
        WSGIScriptAlias / /srv/vhosts/superawesomedns.foo.bar/powerdnsadmin.wsgi

        <Directory "/srv/vhosts/superawesomedns.foo.bar/">
                WSGIProcessGroup pdnsadmin
                WSGIApplicationGroup %{GLOBAL}

                AllowOverride None
                Options +ExecCGI +FollowSymLinks
                SSLRequireSSL
                AllowOverride None
                Require all granted
        </Directory>
</VirtualHost>

Content of /srv/vhosts/superawesomedns.foo.bar/powerdnsadmin.wsgi;

#!/usr/bin/env python3
import sys
sys.path.insert(0, '/srv/vhosts/superawesomedns.foo.bar')

from app import app as application

(this implies that the pdnsadmin user/group exists, and that you have mod_wsgi loaded)

<!-- gh-comment-id:241023006 --> @joachimtingvold commented on GitHub (Aug 19, 2016): Example setup with Apache 2.4 with mod_wsgi; ``` <VirtualHost *:443> ServerName superawesomedns.foo.bar ServerAlias [fe80::1] ServerAdmin webmaster@foo.bar SSLEngine On SSLCertificateFile /some/path/ssl/certs/cert.pem SSLCertificateKeyFile /some/path/ssl/private/cert.key ErrorLog /var/log/apache2/error-superawesomedns.foo.bar.log CustomLog /var/log/apache2/access-superawesomedns.foo.bar.log combined DocumentRoot /srv/vhosts/superawesomedns.foo.bar/ WSGIDaemonProcess pdnsadmin user=pdnsadmin group=pdnsadmin threads=5 WSGIScriptAlias / /srv/vhosts/superawesomedns.foo.bar/powerdnsadmin.wsgi <Directory "/srv/vhosts/superawesomedns.foo.bar/"> WSGIProcessGroup pdnsadmin WSGIApplicationGroup %{GLOBAL} AllowOverride None Options +ExecCGI +FollowSymLinks SSLRequireSSL AllowOverride None Require all granted </Directory> </VirtualHost> ``` Content of `/srv/vhosts/superawesomedns.foo.bar/powerdnsadmin.wsgi`; ``` #!/usr/bin/env python3 import sys sys.path.insert(0, '/srv/vhosts/superawesomedns.foo.bar') from app import app as application ``` (this implies that the pdnsadmin user/group exists, and that you have mod_wsgi loaded)
Author
Owner

@pschiffe commented on GitHub (Aug 19, 2016):

Great. I wasn't sure because there was no info/doc about it. Thanks for the examples. Feel free to close this, or use it for documentation update PR.

<!-- gh-comment-id:241026303 --> @pschiffe commented on GitHub (Aug 19, 2016): Great. I wasn't sure because there was no info/doc about it. Thanks for the examples. Feel free to close this, or use it for documentation update PR.
Author
Owner

@joachimtingvold commented on GitHub (Aug 19, 2016):

I don't have much WSGI-experience, so there are no guarantees that the above examples can be classified as "best practice" (-:

But yeah, an example of nginx should probably also be added together with the above, and put into the documentation for future reference.

<!-- gh-comment-id:241027916 --> @joachimtingvold commented on GitHub (Aug 19, 2016): I don't have much WSGI-experience, so there are no guarantees that the above examples can be classified as "best practice" (-: But yeah, an example of nginx should probably also be added together with the above, and put into the documentation for future reference.
Author
Owner

@pschiffe commented on GitHub (Aug 19, 2016):

Ah, there is a wiki..
https://github.com/ngoduykhanh/PowerDNS-Admin/wiki/uWSGI-example

<!-- gh-comment-id:241028570 --> @pschiffe commented on GitHub (Aug 19, 2016): Ah, there is a wiki.. https://github.com/ngoduykhanh/PowerDNS-Admin/wiki/uWSGI-example
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/PowerDNS-Admin-PowerDNS-Admin#73
No description provided.