Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve English grammar on the deployment doc page #5908

Merged
merged 1 commit into from
Jul 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions docs/deployment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Nginx+supervisord

Running aiohttp servers behind :term:`nginx` makes several advantages.

At first, nginx is the perfect frontend server. It may prevent many
First, nginx is the perfect frontend server. It may prevent many
attacks based on malformed http protocol etc.

Second, running several aiohttp instances behind nginx allows to
Expand All @@ -51,10 +51,10 @@ But this way requires more complex configuration.
Nginx configuration
--------------------

Here is short extraction about writing Nginx configuration file.
Here is short example of an Nginx configuration file.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Here is short example of an Nginx configuration file.
Here is a short example of an Nginx configuration file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, it got automerged before I saw this. Maybe send a follow up?

It does not cover all available Nginx options.

For full reference read `Nginx tutorial
For full details, read `Nginx tutorial
<https://www.nginx.com/resources/admin-guide/>`_ and `official Nginx
documentation
<http://nginx.org/en/docs/http/ngx_http_proxy_module.html>`_.
Expand Down Expand Up @@ -86,8 +86,8 @@ First configure HTTP server itself:
}
}

This config listens on port ``80`` for server named ``example.com``
and redirects everything to ``aiohttp`` backend group.
This config listens on port ``80`` for a server named ``example.com``
and redirects everything to the ``aiohttp`` backend group.

Also it serves static files from ``/path/to/app/static`` path as
``example.com/static``.
Expand Down Expand Up @@ -124,20 +124,20 @@ selection.

.. note::

Nginx is not the only existing *reverse proxy server* but the most
Nginx is not the only existing *reverse proxy server*, but it's the most
popular one. Alternatives like HAProxy may be used as well.

Supervisord
-----------

After configuring Nginx we need to start our aiohttp backends. Better
to use some tool for starting them automatically after system reboot
After configuring Nginx we need to start our aiohttp backends. It's best
to use some tool for starting them automatically after a system reboot
or backend crash.

There are very many ways to do it: Supervisord, Upstart, Systemd,
There are many ways to do it: Supervisord, Upstart, Systemd,
Gaffer, Circus, Runit etc.

Here we'll use `Supervisord <http://supervisord.org/>`_ for example:
Here we'll use `Supervisord <http://supervisord.org/>`_ as an example:

.. code-block:: cfg

Expand All @@ -159,7 +159,7 @@ Here we'll use `Supervisord <http://supervisord.org/>`_ for example:
aiohttp server
--------------

The last step is preparing aiohttp server for working with supervisord.
The last step is preparing the aiohttp server to work with supervisord.

Assuming we have properly configured :class:`aiohttp.web.Application`
and port is specified by command line, the task is trivial:
Expand Down Expand Up @@ -196,25 +196,25 @@ aiohttp can be deployed using `Gunicorn
pre-fork worker model. Gunicorn launches your app as worker processes
for handling incoming requests.

In opposite to deployment with :ref:`bare Nginx
<aiohttp-deployment-nginx-supervisord>` the solution does not need to
manually run several aiohttp processes and use tool like supervisord
for monitoring it. But nothing is for free: running aiohttp
As opposed to deployment with :ref:`bare Nginx
<aiohttp-deployment-nginx-supervisord>`, this solution does not need to
manually run several aiohttp processes and use a tool like supervisord
to monitor them. But nothing is free: running aiohttp
Comment on lines +199 to +202
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
As opposed to deployment with :ref:`bare Nginx
<aiohttp-deployment-nginx-supervisord>`, this solution does not need to
manually run several aiohttp processes and use a tool like supervisord
to monitor them. But nothing is free: running aiohttp
In contrast to deploying with :ref:`bare Nginx
<aiohttp-deployment-nginx-supervisord>`, this solution does not need to
manually run several aiohttp processes. Instead, it uses a tool like supervisord
to monitor them. But nothing is free: running aiohttp

application under gunicorn is slightly slower.


Prepare environment
-------------------

You firstly need to setup your deployment environment. This example is
You first need to setup your deployment environment. This example is
based on `Ubuntu <https://www.ubuntu.com/>`_ 16.04.

Create a directory for your application::

>> mkdir myapp
>> cd myapp

Create Python virtual environment::
Create a Python virtual environment::

>> python3 -m venv venv
>> source venv/bin/activate
Expand Down