diff --git a/README.rst b/README.rst index e5da6718..4c74b79d 100644 --- a/README.rst +++ b/README.rst @@ -54,7 +54,6 @@ Example with test app:: $ cd examples $ gunicorn --workers=2 test:app - Django projects +++++++++++++++ diff --git a/doc/htdocs/.nojekyll b/doc/htdocs/.nojekyll new file mode 100644 index 00000000..e69de29b diff --git a/doc/htdocs/CNAME b/doc/htdocs/CNAME new file mode 100644 index 00000000..b9f0ffbc --- /dev/null +++ b/doc/htdocs/CNAME @@ -0,0 +1 @@ +gunicorn.org diff --git a/doc/htdocs/css/style.css b/doc/htdocs/css/style.css new file mode 100644 index 00000000..a81599bf --- /dev/null +++ b/doc/htdocs/css/style.css @@ -0,0 +1,107 @@ +body { + font-size: 100%; + background: #fff; + +} + + +div.container { + display: block; + width: 40em; + margin: 0 auto; +} + +a { color: #569633; } + +pre { + font-size: 1em; + font-family: 'andale mono', 'lucida console', monospace; + white-space:pre; + margin: 3px; + padding: 8px 20px; + background: #ffd; +} + +h1.title { + padding: 20px; + text-align: center; + background: #489848; + color: #65e565; + font-size: 2em; +} + +h2 { background: #ddd; text-align: center; padding: 4px; } +div.document { + width: 100%; + clear: both; + padding-top: 1.5em; +} + +#green-unicorn p { font-size: 1.3em; color: #444; padding: 1px 10px; } + +#footer { + clear: both; + display: block; + width: 100%; + padding-top: 3em; + text-align: center; + font-size: 0.9em; +} +#footer a { color: #444; } + +#bottom { text-align:center; font-size:14px; padding: 10px 30px; background: #fda; } + +.info, .fork { padding: 10px; } +.content { font-size: 1.2em; } + + + +#links { padding: 10px; } +#links a { font-weight: bold; } + +#header #links { text-align:right; font-size: 18px; } + +h1.logo { + display: block; + z-index: 90; + height: 20px; + float: left; + margin: 0; + padding: 0; +} +h1.logo a { + text-decoration: none; +} + +.title { color: #a10; background: #f86; font-size: 1.4em; font-weight:bold; padding: 3px 8px; margin-bottom: 10px; } +.title a { color: #a10; } +.section p { padding: 1px 14px; font-size: 1.1em; margin-top: 20px; } + + +ul#actions { + list-style: none; + clear: both; + display: block; + width: 100%; +} + +ul#actions li { + display: block; + float: left; + margin-left: 0.6em; + margin-top: 0.6em; + background: #000; + +} + +ul#actions li a { + font-style: bold; + font-size: 2em; + text-transform: capitalize; + color: #fff; + padding: 0.6em; + text-decoration: none; +} + + + diff --git a/doc/htdocs/faq.html b/doc/htdocs/faq.html new file mode 100644 index 00000000..26f7dadf --- /dev/null +++ b/doc/htdocs/faq.html @@ -0,0 +1,2 @@ +
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.
+This is a manual for installing Gunicorn and its dependencies.
+Gunicorn requires Python 2.x superior to 2.5 to work. Python 3.x will be supported soon.
+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):
++$ curl -O http://peak.telecommunity.com/dist/ez_setup.py +$ sudo python ez_setup.py -U setuptools ++
To install or upgrade to the latest released version of Gunicorn:
++$ sudo easy_install -U gunicorn ++
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.
+You could download latest sources from Github Downloads
+Or fetch them with git. Therefore we have to install git and then run:
++$ git clone git://github.com/benoitc/gunicorn.git ++
+$ 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:
++$ python setup.py develop ++
There are various kernel parameters that you might want to tune in order to deal with a large number of simultaneous connections. Generally these should only affect sites with a large number of concurrent requests and apply to any sort of network server you may be running. They're listed here for ease of reference.
+The commands listed are tested under Mac OS X 10.6. Your flavor of Unix may use slightly different flags. Always reference the appropriate man pages if uncertain.
+One of the first settings that usually needs to be bumped is the maximum number of open file descriptors for a given process. For the confused out there, remember that Unices treat sockets as files.
++$ sudo ulimit -n 1024 ++
Listening sockets have an associated queue of incoming connections that are waiting to be accepted. If you happen to have a stampede of clients that fill up this queue new connections will eventually start getting dropped.
++$ sudo sysctl -w kern.ipc.somaxconn="1024" ++
After a socket is closed it eventually enters the TIME_WAIT state. This can become an issue after a prolonged burst of client activity. Eventually the ephemeral port range is used up which can cause new connections to stall while they wait for a valid port.
+This setting is generally only required on machines that are being used to test a network server.
++$ sudo sysctl -w net.inet.ip.portrange.first="8048" ++
Gunicorn can easily be launched from the command line. This manual will show you how to use it with:
+ +Here is how to launch your application in less than 30 seconds. Here is an example with our test application:
++$ cd examples +$ gunicorn --workers=2 test:application ++
+$ gunicorn --help +Usage: gunicorn [OPTIONS] [APP_MODULE] + +Options: + -c CONFIG, --config=CONFIG + Config file. [none] + -b BIND, --bind=BIND Adress to listen on. Ex. 127.0.0.1:8000 or + unix:/tmp/gunicorn.sock + -w WORKERS, --workers=WORKERS + Number of workers to spawn. [1] + -p PIDFILE, --pid=PIDFILE + set the background PID FILE + -D, --daemon Run daemonized in the background. + -m UMASK, --umask=UMASK + Define umask of daemon process + -u USER, --user=USER Change worker user + -g GROUP, --group=GROUP + Change worker group + --log-level=LOGLEVEL Log level below which to silence messages. [info] + --log-file=LOGFILE Log to a file. - equals stdout. [-] + -d, --debug Debug mode. only 1 worker. + --version show program's version number and exit + -h, --help show this help message and exit ++
Django projects can be handled easily by Gunicorn using the gunicorn_django command:
++$ cd yourdjangoproject +$ gunicorn_django --workers=2 ++
But you can also use run_gunicorn admin command like all other commands.
+add gunicorn to INSTALLED_APPS in the settings file:
++INSTALLED_APPS = ( + ... + "gunicorn", +) ++
Then run:
++python manage.py run_gunicorn ++
For Paste compatible projects (like Pylons, TurboGears 2, ...) use the gunicorn_paste command:
++$ cd your pasteproject +$ gunicorn_paste --workers=2 development.ini ++
or usual paster command:
++$ cd your pasteproject +$ paster serve development.ini workers=2 ++
In this case don't forget to add a server section for Gunicorn. Here is an example that use gunicorn as main server:
++[server:main] +use = egg:gunicorn#main +host = 127.0.0.1 +port = 5000 ++