contrib/docker/apache-server/README.rst
author Pierre-Yves David <pierre-yves.david@octobus.net>
Wed, 29 Sep 2021 15:07:21 +0200
changeset 48095 20d0149b8a0a
parent 23399 fd5247a88e63
permissions -rw-r--r--
dirstate-item: use `tracked` instead of `state` in context.matches Differential Revision: https://phab.mercurial-scm.org/D11532
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
23399
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     1
====================
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     2
Apache Docker Server
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     3
====================
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     4
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     5
This directory contains code for running a Mercurial hgweb server via
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     6
mod_wsgi with the Apache HTTP Server inside a Docker container.
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     7
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     8
.. important::
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     9
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    10
   This container is intended for testing purposes only: it is
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    11
   **not** meant to be suitable for production use.
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    12
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    13
Building Image
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    14
==============
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    15
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    16
The first step is to build a Docker image containing Apache and mod_wsgi::
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    17
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    18
  $ docker build -t hg-apache .
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    19
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    20
.. important::
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    21
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    22
   You should rebuild the image whenever the content of this directory
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    23
   changes. Rebuilding after pulling or when you haven't run the container
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    24
   in a while is typically a good idea.
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    25
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    26
Running the Server
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    27
==================
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    28
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    29
To run the container, you'll execute something like::
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    30
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    31
  $ docker run --rm -it -v `pwd`/../../..:/var/hg/source -p 8000:80 hg-apache
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    32
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    33
If you aren't a Docker expert:
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    34
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    35
* ``--rm`` will remove the container when it stops (so it doesn't clutter
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    36
  your system)
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    37
* ``-i`` will launch the container in interactive mode so stdin is attached
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    38
* ``-t`` will allocate a pseudo TTY
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    39
* ``-v src:dst`` will mount the host filesystem at ``src`` into ``dst``
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    40
  in the container. In our example, we assume you are running from this
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    41
  directory and use the source code a few directories up.
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    42
* ``-p 8000:80`` will publish port ``80`` on the container to port ``8000``
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    43
  on the host, allowing you to access the HTTP server on the host interface.
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    44
* ``hg-apache`` is the container image to run. This should correspond to what
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    45
  we build with ``docker build``.
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    46
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    47
.. important::
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    48
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    49
   The container **requires** that ``/var/hg/source`` contain the Mercurial
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    50
   source code.
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    51
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    52
   Upon start, the container will attempt an install of the source in that
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    53
   directory. If the architecture of the host machine doesn't match that of
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    54
   the Docker host (e.g. when running Boot2Docker under OS X), Mercurial's
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    55
   Python C extensions will fail to run. Be sure to ``make clean`` your
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    56
   host's source tree before mounting it in the container to avoid this.
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    57
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    58
When starting the container, you should see some start-up actions (including
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    59
a Mercurial install) and some output saying Apache has started::
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    60
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    61
Now if you load ``http://localhost:8000/`` (or whatever interface Docker
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    62
is using), you should see hgweb running!
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    63
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    64
For your convenience, we've created an empty repository available at
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    65
``/repo``. Feel free to populate it with ``hg push``.
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    66
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    67
Customizing the Server
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    68
======================
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    69
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    70
By default, the Docker container installs a basic hgweb config and an
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    71
empty dummy repository. It also uses some reasonable defaults for
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    72
mod_wsgi.
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    73
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    74
Customizing the WSGI Dispatcher And Mercurial Config
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    75
----------------------------------------------------
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    76
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    77
By default, the Docker environment installs a custom ``hgweb.wsgi``
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    78
file (based on the example in ``contrib/hgweb.wsgi``). The file
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    79
is installed into ``/var/hg/htdocs/hgweb.wsgi``.
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    80
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    81
A default hgweb configuration file is also installed. The ``hgwebconfig``
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    82
file from this directory is installed into ``/var/hg/htdocs/config``.
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    83
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    84
You have a few options for customizing these files.
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    85
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    86
The simplest is to hack up ``hgwebconfig`` and ``entrypoint.sh`` in
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    87
this directory and to rebuild the Docker image. This has the downside
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    88
that the Mercurial working copy is modified and you may accidentally
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    89
commit unwanted changes.
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    90
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    91
The next simplest is to copy this directory somewhere, make your changes,
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    92
then rebuild the image. No working copy changes involved.
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    93
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    94
The preferred solution is to mount a host file into the container and
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    95
overwrite the built-in defaults.
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    96
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    97
For example, say we create a custom hgweb config file in ``~/hgweb``. We
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    98
can start the container like so to install our custom config file::
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    99
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   100
  $ docker run -v ~/hgweb:/var/hg/htdocs/config ...
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   101
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   102
You can do something similar to install a custom WSGI dispatcher::
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   103
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   104
  $ docker run -v ~/hgweb.wsgi:/var/hg/htdocs/hgweb.wsgi ...
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   105
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   106
Managing Repositories
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   107
---------------------
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   108
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   109
Repositories are served from ``/var/hg/repos`` by default. This directory
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   110
is configured as a Docker volume. This means you can mount an existing
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   111
data volume container in the container so repository data is persisted
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   112
across container invocations. See
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   113
https://docs.docker.com/userguide/dockervolumes/ for more.
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   114
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   115
Alternatively, if you just want to perform lightweight repository
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   116
manipulation, open a shell in the container::
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   117
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   118
  $ docker exec -it <container> /bin/bash
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   119
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   120
Then run ``hg init``, etc to manipulate the repositories in ``/var/hg/repos``.
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   121
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   122
mod_wsgi Configuration Settings
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   123
-------------------------------
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   124
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   125
mod_wsgi settings can be controlled with the following environment
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   126
variables.
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   127
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   128
WSGI_PROCESSES
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   129
   Number of WSGI processes to run.
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   130
WSGI_THREADS
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   131
   Number of threads to run in each WSGI process
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   132
WSGI_MAX_REQUESTS
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   133
   Maximum number of requests each WSGI process may serve before it is
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   134
   reaped.
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   135
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   136
See https://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIDaemonProcess
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   137
for more on these settings.
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   138
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   139
.. note::
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   140
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   141
   The default is to use 1 thread per process. The reason is that Mercurial
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   142
   doesn't perform well in multi-threaded mode due to the GIL. Most people
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   143
   run a single thread per process in production for this reason, so that's
fd5247a88e63 docker: add Docker files for running an Apache mod_wsgi server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   144
   what we default to.