<commit_before>==========
User Guide
==========

.. contents:: Table of Contents
   :local:

.. _installation:

Installation
============

.. _letsencrypt-auto:

letsencrypt-auto
----------------

``letsencrypt-auto`` is a wrapper which installs some dependencies
from your OS standard package repositories (e.g using `apt-get` or
`yum`), and for other dependencies it sets up a virtualized Python
environment with packages downloaded from PyPI [#venv]_. It also
provides automated updates.

Firstly, please `install Git`_ and run the following commands:

.. code-block:: shell

   git clone https://github.com/letsencrypt/letsencrypt
   cd letsencrypt


.. _`install Git`: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

.. note:: On RedHat/CentOS 6 you will need to enable the EPEL_
   repository before install.

.. _EPEL: http://fedoraproject.org/wiki/EPEL

To install and run the client you just need to type:

.. code-block:: shell

   ./letsencrypt-auto

.. hint:: During the beta phase, Let's Encrypt enforces strict rate limits on
   the number of certificates issued for one domain. It is recommended to
   initially use the test server via `--test-cert` until you get the desired
   certificates.

Throughout the documentation, whenever you see references to
``letsencrypt`` script/binary, you can substitute in
``letsencrypt-auto``. For example, to get basic help you would type:

.. code-block:: shell

  ./letsencrypt-auto --help

or for full help, type:

.. code-block:: shell

  ./letsencrypt-auto --help all


``letsencrypt-auto`` is the recommended method of running the Let's Encrypt
client beta releases on systems that don't have a packaged version.  Debian,
Arch linux, FreeBSD, and OpenBSD now have native packages, so on those
systems you can just install ``letsencrypt`` (and perhaps
``letsencrypt-apache``).  If you'd like to run the latest copy from Git, or
run your own locally modified copy of the client, follow the instructions in
the :doc:`contributing`.  Some `other methods of installation`_ are discussed
below.


Plugins
=======

The Let's Encrypt client supports a number of different "plugins" that can be
used to obtain and/or install certificates.  Plugins that can obtain a cert
are called "authenticators" and can be used with the "certonly" command.
Plugins that can install a cert are called "installers".  Plugins that do both
can be used with the "letsencrypt run" command, which is the default.

=========== ==== ==== ===============================================================
Plugin      Auth Inst Notes
=========== ==== ==== ===============================================================
apache_     Y    Y    Automates obtaining and installing a cert with Apache 2.4 on
                      Debian-based distributions with ``libaugeas0`` 1.0+.
standalone_ Y    N    Uses a "standalone" webserver to obtain a cert.
webroot_    Y    N    Obtains a cert by writing to the webroot directory of an
                      already running webserver.
manual_     Y    N    Helps you obtain a cert by giving you instructions to perform
                      domain validation yourself.
nginx_      Y    Y    Very experimental and not included in letsencrypt-auto_.
=========== ==== ==== ===============================================================

Future plugins for IMAP servers, SMTP servers, IRC servers, etc, are likely to
be installers but not authenticators.

Apache
------

If you're running Apache 2.4 on a Debian-based OS with version 1.0+ of
the ``libaugeas0`` package available, you can use the Apache plugin.
This automates both obtaining *and* installing certs on an Apache
webserver. To specify this plugin on the command line, simply include
``--apache``.

Standalone
----------

To obtain a cert using a "standalone" webserver, you can use the
standalone plugin by including ``certonly`` and ``--standalone``
on the command line. This plugin needs to bind to port 80 or 443 in
order to perform domain validation, so you may need to stop your
existing webserver. To control which port the plugin uses, include
one of the options shown below on the command line.

    * ``--standalone-supported-challenges http-01`` to use port 80
    * ``--standalone-supported-challenges tls-sni-01`` to use port 443

Webroot
-------

If you're running a webserver that you don't want to stop to use
standalone, you can use the webroot plugin to obtain a cert by
including ``certonly`` and ``--webroot`` on the command line. In
addition, you'll need to specify ``--webroot-path`` or ``-w`` with the root
directory of the files served by your webserver. For example,
``--webroot-path /var/www/html`` or
``--webroot-path /usr/share/nginx/html`` are two common webroot paths.

If you're getting a certificate for many domains at once, each domain will use
the most recent ``--webroot-path``.  So for instance:

``letsencrypt certonly --webroot -w /var/www/example/ -d www.example.com -d example.com -w /var/www/eg -d eg.is -d www.eg.is``

Would obtain a single certificate for all of those names, using the
``/var/www/example`` webroot directory for the first two, and
``/var/www/eg`` for the second two.

Note that to use the webroot plugin, your server must be configured to serve
files from hidden directories.

Manual
------

If you'd like to obtain a cert running ``letsencrypt`` on a machine
other than your target webserver or perform the steps for domain
validation yourself, you can use the manual plugin. While hidden from
the UI, you can use the plugin to obtain a cert by specifying
``certonly`` and ``--manual`` on the command line. This requires you
to copy and paste commands into another terminal session.

Nginx<commit_msg>Document webroot request path.<commit_after>==========
User Guide
==========

.. contents:: Table of Contents
   :local:

.. _installation:

Installation
============

.. _letsencrypt-auto:

letsencrypt-auto
----------------

``letsencrypt-auto`` is a wrapper which installs some dependencies
from your OS standard package repositories (e.g using `apt-get` or
`yum`), and for other dependencies it sets up a virtualized Python
environment with packages downloaded from PyPI [#venv]_. It also
provides automated updates.

Firstly, please `install Git`_ and run the following commands:

.. code-block:: shell

   git clone https://github.com/letsencrypt/letsencrypt
   cd letsencrypt


.. _`install Git`: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

.. note:: On RedHat/CentOS 6 you will need to enable the EPEL_
   repository before install.

.. _EPEL: http://fedoraproject.org/wiki/EPEL

To install and run the client you just need to type:

.. code-block:: shell

   ./letsencrypt-auto

.. hint:: During the beta phase, Let's Encrypt enforces strict rate limits on
   the number of certificates issued for one domain. It is recommended to
   initially use the test server via `--test-cert` until you get the desired
   certificates.

Throughout the documentation, whenever you see references to
``letsencrypt`` script/binary, you can substitute in
``letsencrypt-auto``. For example, to get basic help you would type:

.. code-block:: shell

  ./letsencrypt-auto --help

or for full help, type:

.. code-block:: shell

  ./letsencrypt-auto --help all


``letsencrypt-auto`` is the recommended method of running the Let's Encrypt
client beta releases on systems that don't have a packaged version.  Debian,
Arch linux, FreeBSD, and OpenBSD now have native packages, so on those
systems you can just install ``letsencrypt`` (and perhaps
``letsencrypt-apache``).  If you'd like to run the latest copy from Git, or
run your own locally modified copy of the client, follow the instructions in
the :doc:`contributing`.  Some `other methods of installation`_ are discussed
below.


Plugins
=======

The Let's Encrypt client supports a number of different "plugins" that can be
used to obtain and/or install certificates.  Plugins that can obtain a cert
are called "authenticators" and can be used with the "certonly" command.
Plugins that can install a cert are called "installers".  Plugins that do both
can be used with the "letsencrypt run" command, which is the default.

=========== ==== ==== ===============================================================
Plugin      Auth Inst Notes
=========== ==== ==== ===============================================================
apache_     Y    Y    Automates obtaining and installing a cert with Apache 2.4 on
                      Debian-based distributions with ``libaugeas0`` 1.0+.
standalone_ Y    N    Uses a "standalone" webserver to obtain a cert.
webroot_    Y    N    Obtains a cert by writing to the webroot directory of an
                      already running webserver.
manual_     Y    N    Helps you obtain a cert by giving you instructions to perform
                      domain validation yourself.
nginx_      Y    Y    Very experimental and not included in letsencrypt-auto_.
=========== ==== ==== ===============================================================

Future plugins for IMAP servers, SMTP servers, IRC servers, etc, are likely to
be installers but not authenticators.

Apache
------

If you're running Apache 2.4 on a Debian-based OS with version 1.0+ of
the ``libaugeas0`` package available, you can use the Apache plugin.
This automates both obtaining *and* installing certs on an Apache
webserver. To specify this plugin on the command line, simply include
``--apache``.

Standalone
----------

To obtain a cert using a "standalone" webserver, you can use the
standalone plugin by including ``certonly`` and ``--standalone``
on the command line. This plugin needs to bind to port 80 or 443 in
order to perform domain validation, so you may need to stop your
existing webserver. To control which port the plugin uses, include
one of the options shown below on the command line.

    * ``--standalone-supported-challenges http-01`` to use port 80
    * ``--standalone-supported-challenges tls-sni-01`` to use port 443

Webroot
-------

If you're running a webserver that you don't want to stop to use
standalone, you can use the webroot plugin to obtain a cert by
including ``certonly`` and ``--webroot`` on the command line. In
addition, you'll need to specify ``--webroot-path`` or ``-w`` with the root
directory of the files served by your webserver. For example,
``--webroot-path /var/www/html`` or
``--webroot-path /usr/share/nginx/html`` are two common webroot paths.

If you're getting a certificate for many domains at once, each domain will use
the most recent ``--webroot-path``.  So for instance:

``letsencrypt certonly --webroot -w /var/www/example/ -d www.example.com -d example.com -w /var/www/eg -d eg.is -d www.eg.is``

Would obtain a single certificate for all of those names, using the
``/var/www/example`` webroot directory for the first two, and
``/var/www/eg`` for the second two.

The webroot plugin works by creating a temporary file for each of your requested
domains in ``${webroot-path}/.well-known/acme-challenge``. Then the Let's
Encrypt validation server makes HTTP requests to validate that the DNS for each
requested domain resolves to the server running letsencrypt. An example request
made to your web server would look like:

::

    192.168.127.12 - - [05/Jan/2016:20:11:24 -0500] "GET /.well-known/acme-challenge/HGr8U1IeTW4kY_Z6UIyaakzOkyQgPr_7ArlLgtZE8SX HTTP/1.1" 200 87 "-" "Mozilla/5.0 (compatible; Let's Encrypt validation server; +https://www.letsencrypt.org)"

Note that to use the webroot plugin, your server must be configured to serve
files from hidden directories.


Manual
------

If you'd like to obtain a cert running ``letsencrypt`` on a machine
other than your target webserver or perform the steps for domain
validation yourself, you can use the manual plugin. While hidden from
the UI, you can use the plugin to obtain a cert by specifying
``certonly`` and ``--manual`` on the command line. This requires you
to copy and paste commands into another terminal session.

Nginx
{'fraction_non_alphanumeric': 0.12699600798403193, 'fraction_numerical': 0.007817697937458417, 'mean_word_length': 3.739850216791486, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 5, 'lorem ipsum': 0, 'www.': 15, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2679159', 'n_tokens_mistral': 3408, 'n_tokens_neox': 3209, 'n_words': 1567}