Edgewall Software

Changes between Version 10 and Version 11 of Gunicorn


Ignore:
Timestamp:
Feb 19, 2015, 8:44:18 AM (9 years ago)
Author:
figaro
Comment:

Cosmetic changes

Legend:

Unmodified
Added
Removed
Modified
  • Gunicorn

    v10 v11  
    551. Install gunicorn
    66
    7 Gunicorn is a Python project which lives on pypi, so we can use easy_install or pip to install gunicorn:
     7Gunicorn is a Python project which lives on pypi, so we can use easy_install or pip to install Gunicorn:
    88{{{#!sh
    99$> pip install gunicorn
    1010}}}
    1111
    12 I prefer to use a [http://pypi.python.org/pypi/virtualenv virtualenv], to not have to install gunicorn in a system wide fashion.
     12I prefer to use a [http://pypi.python.org/pypi/virtualenv virtualenv], to not have to install Gunicorn in a system wide fashion.
    1313
    14142. Write your wsgi file
     
    4343
    4444In your web browser go to http://localhost:8000 and it should work.
    45 How it works: gunicorn is looking for a method called "application" in the tracwsgi.py file.
     45How it works: Gunicorn is looking for a method called "application" in the tracwsgi.py file.
    4646
    47473. Configure Nginx
    4848
    49 So, now we have Gunicorn running, but we will make it work with Nginx which will redirect Trac requests to gunicorn:
     49Now we will make it work with Nginx, which will redirect Trac requests to Gunicorn:
    5050
    5151{{{#!nginx
     
    7777}}}
    7878
    79 '''Note''': Nginx will redirect requests to a UNIX socket. It can be a simple ip:port combination. It can be a multiple instance of gunicorn. Take a look in the [http://wiki.nginx.org/HttpUpstreamModule Nginx documentation].
     79'''Note''': Nginx will redirect requests to a UNIX socket. This can either be a simple ip:port combination or multiple instances of Gunicorn. Take a look in the [http://wiki.nginx.org/HttpUpstreamModule Nginx documentation].
    8080
    81 To add a basic or digest authentication, you'll have to provide a file as in the example above, created using htpasswd file.
    82 To make gunicorn listen on a unix socket, add this option:
     81To add a basic or digest authentication, you will have to provide a file as in the example above, created using the htpasswd file.
     82To make Gunicorn listen on a UNIX socket, add this option:
    8383
    8484{{{#!sh
     
    8686}}}
    8787
    88 '''Note''': It seems the WSGI entry point does not handle the digest or basic http authentication. To ensure the authentication middleware is passed, you have to hack a little bit the `tracwsgi.py`:
     88'''Note''': It seems the WSGI entry point does not handle the digest or basic http authentication. To ensure the authentication middleware is passed, you have to modify `tracwsgi.py`:
    8989
    9090{{{#!python
     
    105105}}}
    106106
    107 '''Note''': if using digest authentication you must create the authentication handler outside of the application def, otherwise the !DigestAuthentication object won't retain state between requests.
     107'''Note''': If you are using digest authentication, you must create the authentication handler outside of the application def, otherwise the !DigestAuthentication object won't retain state between requests.
    108108
    109109{{{#!python