$ sudo easy_install virtualenv $ mkdir ~/environments/ $ virtualenv ~/environments/tutorial/ $ cd ~/environments/tutorial/ $ ls bin include lib $ source bin/activate (tutorial) $ ./bin/easy_install gunicorn (tutorial) $ mkdir myapp (tutorial) $ cd myapp/ (tutorial) $ vi myapp.py (tutorial) $ cat myapp.py def app(environ, start_response): data = "Hello, World!\n" start_response("200 OK", [ ("Content-Type", "text/plain"), ("Content-Length", str(len(data))) ]) return iter([data]) (tutorial) $ ../bin/gunicorn -w 4 myapp:app 2010-06-05 23:27:07 [16800] [INFO] Arbiter booted 2010-06-05 23:27:07 [16800] [INFO] Listening at: http://127.0.0.1:8000 2010-06-05 23:27:07 [16801] [INFO] Worker spawned (pid: 16801) 2010-06-05 23:27:07 [16802] [INFO] Worker spawned (pid: 16802) 2010-06-05 23:27:07 [16803] [INFO] Worker spawned (pid: 16803) 2010-06-05 23:27:07 [16804] [INFO] Worker spawned (pid: 16804)
Gunicorn 'Green Unicorn' is a Python WSGI HTTP Server for UNIX. It's a pre-fork worker model ported from Ruby's Unicorn project. The Gunicorn server is broadly compatible with various web frameworks, simply implemented, light on server resources, and fairly speedy.
--limit-request-line
or set the
limit_request_line
in your configuration file to set the max
size of the request line in bytes.--limit-request-fieldsw
and
limit-request-field-size
settingsp
variable to the log access format to log
pidfile{HeaderName}o
variable to the logo access format to
log the response header HeaderName{HeaderName}i
in the access log filegunicorn_django
& run_gunicorn
commandX-Forwarded-For
header key and
disable it by setting an empty string.