From b202c879bd4cb8ba4f613a2b09446373dd517116 Mon Sep 17 00:00:00 2001 From: "Paul J. Davis" Date: Sat, 20 Feb 2010 14:12:32 -0500 Subject: [PATCH] Editing the documentation. --- doc/htdocs/configuration.html | 71 +++++++++++++++--------------- doc/htdocs/index.html | 24 +++++----- doc/htdocs/installation.html | 39 +++++++++-------- doc/htdocs/usage.html | 44 ++++++++++--------- doc/site/configuration.rst | 82 +++++++++++++++++------------------ doc/site/index.rst | 31 +++++++------ doc/site/installation.rst | 33 +++++++------- doc/site/usage.rst | 70 +++++++++++++++--------------- 8 files changed, 204 insertions(+), 190 deletions(-) diff --git a/doc/htdocs/configuration.html b/doc/htdocs/configuration.html index a2aeecaa..dab7da07 100644 --- a/doc/htdocs/configuration.html +++ b/doc/htdocs/configuration.html @@ -46,57 +46,58 @@
-

This manual to setup Gunicorn in production and use the configuration file.

-

The configuration file

-

Gunicorn 0.5 introduced the ability to read configuration from a file. Gunicorn will either look for "gunicorn.conf.py" in the current directory or a file referred through the -c flag.

-

See github.com/benoitc/gunicorn/blob/master/examples/gunicorn.conf.py.sample for an example of configuration file.

-

Default configuration settings are:

+

The Configuration File

+

Gunciorn 0.5 introduced the ability to use a Python configuration file. Gunicorn will look for gunicorn.conf.py in the current working directory or what ever path is specified on the command line with the -c option.

+

A configuration file with default settings would look like this:

-bind='127.0.0.1:8000',
-daemon=False,
-debug=False,
-logfile='-',
-loglevel='info',
-pidfile=None,
-workers=1,
-umask=0,
-user=None,
-group=None,
+bind = "127.0.0.1:8000" # Or "unix:/tmp/gunicorn.sock"
+daemon = False          # Whether work in the background
+debug = False           # Some extra logging
+logfile = "-"           # Name of the log file
+loglevel = "info"       # The level at which to log
+pidfile = None          # Path to a PID file
+workers = 1             # Number of workers to initialize
+umask = 0               # Umask to set when daemonizing
+user = None             # Change process owner to user
+group = None            # Change process group to group
 
-after_fork=lambda server, worker: server.log.info(
-                "worker=%s spawned pid=%s" % (worker.id, str(worker.pid))),
+def after_fork(server, worker):
+    fmt = "worker=%s spawned pid=%s"
+    server.log.info(fmt % (worker.id, worker.pid))
 
-before_fork=lambda server, worker: server.log.info(
-                "worker=%s spawning" % worker.id),
+def before_fork(server, worker):
+    fmt = "worker=%s spawning"
+    server.log.info(fmt % worker.id)
 
-before_exec=lambda server: server.log.info("forked child, reexecuting")
+def before_exec(server):
+    serer.log.info("Forked child, reexecuting.")
 
-
after_fork:
-
this function is called by the worker after forking. Arguments are the master and worker instances.
-
before_fork:
-
this function is called by the worker before forking. Arguments are the master and worker instances.
-
before_exec:
-
this function is called before relaunching the master. This happens when the master receive HUP or USR2 signals.
+
after_fork(server, worker):
+
This is called by the worker after initialization.
+
before_fork(server, worker):
+
This is called by the worker just before forking.
+
before_exec(server):
+
This function is called before relaunching the master. This happens when the master receives a HUP or USR2 signal.
bind:
-
address on which workers are listening. It could be a tcp address IP:PORT or a unix address unix:/path/to/sockfile.
+
The address on which workers are listening. It can be a TCP address with a format of IP:PORT or a Unix socket address like unix:/path/to/socketfile.
daemon:
-
Start in daemonized mode.
+
Whether or not to detach the server from the controlling terminal.
debug:
-
if set to True, only one worker will be launch and`the variable wsgi.multiprocess will be set to False.
+
If True, only one worker will be launch and the variable wsgi.multiprocess will be set to False.
group:
-
the group on which workers processes will be launched.
+
The group in which worker processes will be launched.
logfile:
-
path to the log file. - (stdout) by default.
+
The path to the log file - (stdout) by default.
loglevel:
-
set debug level: info, debug, error
+
The level at which to log. info, debug, or error for instance. Only log messages of equal or greater severity are logged.
pidfile:
-
file where master PID number will be saved
+
A file to store the master's PID.
umask:
-
in daemon mode, fix user mask of master.
+
Used to set the umask when daemonizing.
user:
-
the user on which workers processes will be launched.
+
The user as which worker processes will by launched.
diff --git a/doc/htdocs/index.html b/doc/htdocs/index.html index 013b680d..c7c70937 100644 --- a/doc/htdocs/index.html +++ b/doc/htdocs/index.html @@ -34,23 +34,23 @@

Green Unicorn

-

gunicorn 'Green Unicorn' is a WSGI HTTP Server for UNIX, fast clients and nothing else.

-

This is a port of Unicorn (http://unicorn.bogomips.org/) in Python. Meet us on #gunicorn irc channel on Freenode.

-

Gunicorn is under MIT License. see LICENSE file for more details.

+

Green Unicorn (gunicorn) is an HTTP/WSGI Server for UNIX designed to serve fast clients and nothing else.

+

This is a port of Unicorn in Python. Meet us on the #gunicorn IRC channel on Freenode.

+

Gunicorn is released under the MIT License. See the LICENSE for more details.

Features

    -
  • Designed for WSGI, Unix and fast clients.
  • -
  • Compatible with Python 2.x superior to 2.5
  • -
  • Easy integration with Django and Paster compatible applications (Pylons, Turbogears 2, ...)
  • -
  • Process management: Gunicorn reap and restart workers that die.
  • -
  • Load balancing done by the os
  • -
  • Graceful restart of workers
  • +
  • Designed for Unix, WSGI, and fast clients
  • +
  • Compatible with Python 2.x (>= 2.5)
  • +
  • Easy integration with Django and Paster compatible applications (Pylons, TurboGears 2, ...)
  • +
  • Process management: Gunicorn reaps and restarts workers that die.
  • +
  • Load balancing via pre-fork and a shared socket
  • +
  • Graceful worker process restarts
  • Upgrade "àla nginx" without losing connections
  • -
  • Simple and easy Python DSL for configuration
  • +
  • Simple and easy Python configuration
  • Decode chunked transfers on-the-fly, allowing upload progress notifications or -stream-based protocols over HTTP.
  • -
  • post/pre fork hooks
  • +stream-based protocols over HTTP +
  • Post- and pre-fork hooks
diff --git a/doc/htdocs/installation.html b/doc/htdocs/installation.html index ca62d483..106a77ed 100644 --- a/doc/htdocs/installation.html +++ b/doc/htdocs/installation.html @@ -45,14 +45,19 @@
-
-

This is a manual for installing Gunicorn and its dependencies.

-
-

Installing Gunicorn

-

Gunicorn requires Python 2.x superior to 2.5 to work. Python 3.x will be supported soon.

+
+

Installation

+
+

Requirements

+
    +
  • Python 2.5 or newer (Python 3.x will be supported soon)
  • +
  • setuptools >= 0.6c6
  • +
  • nosetests (for the test suite only)
  • +
+
-

Installing with easy_install

-

To install Gunicorn using easy_install you must make sure you have a recent version of setuptools installed (as of this writing, 0.6c6 (0.6a9 on windows) or later):

+

Installing with easy_install

+

If you don't already have easy_install available you'll want to download and run the ez_setup.py script:

 $ curl -O http://peak.telecommunity.com/dist/ez_setup.py
 $ sudo python ez_setup.py -U setuptools
@@ -61,25 +66,23 @@ $ sudo python ez_setup.py -U setuptools
 
 $ sudo easy_install -U gunicorn
 
+
-

Installing from source

-

To install Gunicorn from source, simply use the normal procedure for installing any Python package. Since Gunicorn uses setuptools, all dependencies (including setuptools itself) will be automatically acquired and installed for you as appropriate.

-
-
-
-

Fetch sources

-

You could download latest sources from Github Downloads

-

Or fetch them with git. Therefore we have to install git and then run:

+

Installing from source

+

You can install Gunicorn from source as simply as you would install any other Python package. Gunicorn uses setuptools which will automatically fetch all dependencies (including setuptools itself).

+
+

Get a Copy

+

You can download a tarball of the latest sources from GitHub Downloads or fetch them with git:

 $ git clone git://github.com/benoitc/gunicorn.git
 
-
-

Install Gunicorn

+
+

Installation

 $ python setup.py install
 
-

If you're using a git clone, it's recommended to use the setuptools develop command, which will simply activate Gunicorn directly from your source directory. This way you can do a hg fetch or make changes to the source code without re-installing every time:

+

If you've cloned the git repository, its highly recommended that you use the develop command which will allow you to use Gunicorn from the source directory. This will allow you to keep up to date with development on GitHub as well as make changes to the source:

 $ python setup.py develop
 
diff --git a/doc/htdocs/usage.html b/doc/htdocs/usage.html index 8cbcd67d..a46a69e6 100644 --- a/doc/htdocs/usage.html +++ b/doc/htdocs/usage.html @@ -2,7 +2,7 @@ - Green Unicorn - Command line usage + Green Unicorn - Command Line Usage