mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
212 lines
10 KiB
HTML
212 lines
10 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title>Green Unicorn - Install</title>
|
|
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
|
|
</head>
|
|
<body>
|
|
<div id="container" class="twocolumn">
|
|
<div id="menu">
|
|
<div class="logo">
|
|
<a href="./">
|
|
<img src="images/gunicorn.png" alt="Gunicorn - Green Unicorn" />
|
|
</a>
|
|
</div>
|
|
<ul id="actions">
|
|
<li><a href="install.html">Install</a></li>
|
|
<li><a href="run.html">Run</a></li>
|
|
<li><a href="configure.html">Configure</a></li>
|
|
<li><a href="deploy.html">Deploy</a></li>
|
|
<li><a href="design.html">Design</a></li>
|
|
<li><a href="faq.html">FAQ</a></li>
|
|
<li><a href="community.html">Community</a></li>
|
|
<li><a href="news.html">News</a></li>
|
|
<li><a href="http://github.com/benoitc/gunicorn/">Code</a></li>
|
|
<li><a href="http://github.com/benoitc/gunicorn/issues">Issues</a></li>
|
|
</ul>
|
|
</div>
|
|
<div id="content">
|
|
<div class="document">
|
|
<div class="section" id="requirements">
|
|
<h2><a class="toc-backref" href="#contents">Requirements</a></h2>
|
|
<ul class="simple">
|
|
<li><strong>Python 2.x >= 2.5</strong> (Python 3.x will be supported soon)</li>
|
|
<li>setuptools >= 0.6c6</li>
|
|
<li>nosetests (for the test suite only)</li>
|
|
</ul>
|
|
</div>
|
|
<div class="section" id="with-easy-install">
|
|
<h2><a class="toc-backref" href="#contents">With easy_install</a></h2>
|
|
<p>If you don't already have <tt class="docutils literal">easy_install</tt> available you'll want to download
|
|
and run the <tt class="docutils literal">ez_setup.py</tt> script:</p>
|
|
<pre class="literal-block">
|
|
$ curl -O http://peak.telecommunity.com/dist/ez_setup.py
|
|
$ sudo python ez_setup.py -U setuptools
|
|
</pre>
|
|
<p>To install or upgrade to the latest released version of Gunicorn:</p>
|
|
<pre class="literal-block">
|
|
$ sudo easy_install -U gunicorn
|
|
</pre>
|
|
<div class="note">
|
|
<p class="first admonition-title">Note</p>
|
|
<p>There is a limited support version of Gunicorn that is compatible
|
|
with Python 2.4. This fork is managed by Randall Leeds and can be
|
|
found <a class="reference external" href="http://github.com/tilgovi/gunicorn">here on github</a>. To install this version you must specify
|
|
the full url to something like <tt class="docutils literal">pip</tt>. This hasn't been tested
|
|
wtih <tt class="docutils literal">easy_install</tt> just yet:</p>
|
|
<pre class="last literal-block">
|
|
$ pip install -f http://github.com/tilgovi/gunicorn/tarball/py24 gunicorn
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="from-source">
|
|
<h2><a class="toc-backref" href="#contents">From Source</a></h2>
|
|
<p>You can install Gunicorn from source just as you would install any other
|
|
Python package. Gunicorn uses setuptools which will automatically fetch all
|
|
dependencies (including setuptools itself).</p>
|
|
<p>You can download a tarball of the latest sources from <a class="reference external" href="http://github.com/benoitc/gunicorn/downloads">GitHub Downloads</a> or
|
|
fetch them with <a class="reference external" href="http://git-scm.com/">git</a>:</p>
|
|
<pre class="literal-block">
|
|
# Using git:
|
|
$ git clone git://github.com/benoitc/gunicorn.git
|
|
$ cd gunicorn
|
|
|
|
# Or using a tarball:
|
|
$ wget http://github.com/benoitc/gunicorn/tarball/master -o gunicorn.tar.gz
|
|
$ tar -xvzf gunicorn.tar.gz
|
|
$ cd gunicorn-$HASH/
|
|
|
|
# Install
|
|
$ sudo python setup.py install
|
|
</pre>
|
|
<p>If you've cloned the git repository, its highly recommended that you use the
|
|
<tt class="docutils literal">develop</tt> 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:</p>
|
|
<pre class="literal-block">
|
|
$ python setup.py develop
|
|
</pre>
|
|
</div>
|
|
<div class="section" id="async-workers">
|
|
<h2><a class="toc-backref" href="#contents">Async Workers</a></h2>
|
|
<p>You may also want to install <a class="reference external" href="http://eventlet.net">Eventlet</a> or <a class="reference external" href="http://gevent.org">Gevent</a> if you expect that your
|
|
application code may need to pause for extended periods of time during request
|
|
processing. Check out the <a class="reference external" href="design.html">design docs</a> for more information on when you'll
|
|
want to consider one of the alternate worker types.</p>
|
|
<pre class="literal-block">
|
|
$ easy_install -U greenlet # Required for both
|
|
$ easy_install -U eventlet # For eventlet workers
|
|
$ easy_install -U gevent # For gevent workers
|
|
</pre>
|
|
<div class="note">
|
|
<p class="first admonition-title">Note</p>
|
|
<p>If installing <tt class="docutils literal">greenlet</tt> fails you probably need to install
|
|
the Python headers. These headers are available in most package
|
|
managers. On Ubuntu the package name for <tt class="docutils literal"><span class="pre">apt-get</span></tt> is
|
|
<tt class="docutils literal"><span class="pre">python-dev</span></tt>.</p>
|
|
<p class="last"><a class="reference external" href="http://gevent.org">Gevent</a> also requires that <tt class="docutils literal">libevent</tt> 1.4.x or 2.0.4 is installed.
|
|
This could be a more recent version than what is available in your
|
|
package manager. If <a class="reference external" href="http://gevent.org">Gevent</a> fails to build even with <a class="reference external" href="http://monkey.org/~provos/libevent">libevent</a>
|
|
installed, this is the most likely reason.</p>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="debian-gnu-linux">
|
|
<h2><a class="toc-backref" href="#contents">Debian GNU/Linux</a></h2>
|
|
<p>If you are using Debian GNU/Linux is is recommended that you use system
|
|
packages to install Gunicorn. This has a number of advantages:</p>
|
|
<blockquote>
|
|
<ul class="simple">
|
|
<li>Zero-effort installation: Automatically starts multiple Gunicorn instances
|
|
based on configurations defined in <tt class="docutils literal">/etc/gunicorn.d</tt>.</li>
|
|
<li>Sensible default locations for logs (<tt class="docutils literal">/var/log/gunicorn</tt>). Logs
|
|
can be automatically rotated and compressed using <tt class="docutils literal">logrotate</tt>.</li>
|
|
<li>Improved security: Can easily run each Gunicorn instance with a dedicated
|
|
UNIX user/group.</li>
|
|
<li>Sensible upgrade path: Upgrades to newer versions result in less downtime,
|
|
handle conflicting changes in configuration options, and can be quickly
|
|
rolled back in case of incompatibility. The package can also be purged
|
|
entirely from the system in seconds.</li>
|
|
</ul>
|
|
</blockquote>
|
|
<div class="section" id="stable-squeeze">
|
|
<h3><a class="toc-backref" href="#contents">Stable ("squeeze")</a></h3>
|
|
<p>The version of Gunicorn in the <a class="reference external" href="http://www.debian.org/">Debian</a> "stable" distribution is 0.10.0 (July
|
|
2010). It is not recommended that you use this version.</p>
|
|
<p>However, you can use the most recent version by using <a class="reference external" href="http://backports.debian.org/">Debian Backports</a>.
|
|
First, copy the following line to your <tt class="docutils literal">/etc/apt/sources.list</tt>:</p>
|
|
<pre class="literal-block">
|
|
deb http://backports.debian.org/debian-backports squeeze-backports main
|
|
</pre>
|
|
<p>Then, update your local package lists:</p>
|
|
<pre class="literal-block">
|
|
$ sudo apt-get update
|
|
</pre>
|
|
<p>You can then install the latest version using:</p>
|
|
<pre class="literal-block">
|
|
$ sudo apt-get -t squeeze-backports install gunicorn
|
|
</pre>
|
|
</div>
|
|
<div class="section" id="testing-wheezy-unstable-sid">
|
|
<h3><a class="toc-backref" href="#contents">Testing ("wheezy") / Unstable ("sid")</a></h3>
|
|
<p>"wheezy" and "sid" contain the latest released version of Gunicorn. You can
|
|
install it in the usual way:</p>
|
|
<pre class="literal-block">
|
|
$ sudo apt-get install gunicorn
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="ubuntu">
|
|
<h2><a class="toc-backref" href="#contents">Ubuntu</a></h2>
|
|
<p>If you use <a class="reference external" href="http://www.ubuntu.com/">Ubuntu</a> karmic, you can update your system with packages from
|
|
our <a class="reference external" href="https://launchpad.net/~bchesneau/+archive/gunicorn">PPA</a> by adding <tt class="docutils literal">ppa:bchesneau/gunicorn</tt> to your system's Software
|
|
Sources.</p>
|
|
<p>Or this PPA can be added to your system manually by copying the lines below
|
|
and adding them to your system's software sources:</p>
|
|
<pre class="literal-block">
|
|
deb http://ppa.launchpad.net/bchesneau/gunicorn/ubuntu karmic main
|
|
deb-src http://ppa.launchpad.net/bchesneau/gunicorn/ubuntu karmic main
|
|
</pre>
|
|
<div class="section" id="signing-key">
|
|
<h3><a class="toc-backref" href="#contents">Signing key</a></h3>
|
|
<pre class="literal-block">
|
|
1024R/15E5EB06
|
|
</pre>
|
|
</div>
|
|
<div class="section" id="fingerprint">
|
|
<h3><a class="toc-backref" href="#contents">Fingerprint</a></h3>
|
|
<pre class="literal-block">
|
|
49AEEDFF5CDCD82CEA8AB4DABC981A8115E5EB06
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="toc">
|
|
<div class="contents topic" id="contents">
|
|
<p class="topic-title first">Contents</p>
|
|
<ul class="simple">
|
|
<li><a class="reference internal" href="#requirements" id="id2">Requirements</a></li>
|
|
<li><a class="reference internal" href="#with-easy-install" id="id3">With easy_install</a></li>
|
|
<li><a class="reference internal" href="#from-source" id="id4">From Source</a></li>
|
|
<li><a class="reference internal" href="#async-workers" id="id5">Async Workers</a></li>
|
|
<li><a class="reference internal" href="#debian-gnu-linux" id="id6">Debian GNU/Linux</a><ul>
|
|
<li><a class="reference internal" href="#stable-squeeze" id="id7">Stable ("squeeze")</a></li>
|
|
<li><a class="reference internal" href="#testing-wheezy-unstable-sid" id="id8">Testing ("wheezy") / Unstable ("sid")</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a class="reference internal" href="#ubuntu" id="id9">Ubuntu</a><ul>
|
|
<li><a class="reference internal" href="#signing-key" id="id10">Signing key</a></li>
|
|
<li><a class="reference internal" href="#fingerprint" id="id11">Fingerprint</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div id="footer">
|
|
<p>Site Content License <a rel="license" href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 Unported License</a>.</p>
|
|
<p>Hosted on <a href="http://github.com/">GitHub</a></p>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |