Difference between revisions of "UWSGI"

From ArchWiki
Jump to: navigation, search
m (See Also)
m (See Also)
Line 51: Line 51:
* [http://flask.pocoo.org/docs/deploying/uwsgi/ Flash uwsgi deploying]
* [http://flask.pocoo.org/docs/deploying/uwsgi/ Flash uwsgi deploying]
* [https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/uwsgi/ Django and uWSGI]
* [https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/uwsgi/ Django and uWSGI]
* [http://www.youtube.com/watch?v=tD6UCfPCVLA Flask with uwsgi and nginx video]

Revision as of 09:57, 6 August 2013


Install package uwsgi in the official repositories. Note, the package does not come with plugins as it is just a compact package. External plugins have to be installed separately.

Starting Service

To enable the uwsgi service by default at start-up, run:

# systemctl enable uwsgi@helloworld.service


# systemctl enable uwsgi@helloworld.socket


You can create a configuration by editing and putting that in /etc/uwsgi/. There is a build file shipped with the package located at /etc/uwsgi/archlinux.ini.

More details can be found here: [1].

Application configuration

The following is a simple example to get python support. You may need to install the uwsgi-plugin-python or uwsgi-plugin-python2 plugin from the community repository by pacman.

chdir = /srv/http/helloworld
module = helloworld
plugins = python

It is also possible to run uwsgi separately with the following syntax for instance:

uwsgi --socket --plugin python2 --wsgi-file ~/foo.py --master --processes 4 --threads 2 --stats --uid --gid

Note, you should avoid running this command as root.

Nginx configuration
location / {
    root   /usr/share/nginx/html;
    index  index.html index.htm;
    include uwsgi_params;
    # uwsgi_pass unix:/var/run/uwsgi/helloworld.sock;

See Also