123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443 |
- <!DOCTYPE html>
- <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
- <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-
-
- <title>Installation des certificats letsencrypt - The Yojik Server Installation Guide</title>
-
- <link rel="shortcut icon" href="../img/favicon.ico">
-
- <link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
- <link rel="stylesheet" href="../css/theme.css" type="text/css" />
- <link rel="stylesheet" href="../css/theme_extra.css" type="text/css" />
- <link rel="stylesheet" href="../css/highlight.css">
-
- <script>
- // Current page data
- var mkdocs_page_name = "Installation des certificats letsencrypt";
- var mkdocs_page_input_path = "11-onze.md";
- var mkdocs_page_url = "/11-onze/";
- </script>
-
- <script src="../js/jquery-2.1.1.min.js"></script>
- <script src="../js/modernizr-2.8.3.min.js"></script>
- <script type="text/javascript" src="../js/highlight.pack.js"></script>
- <script src="../js/theme.js"></script>
-
- </head>
- <body class="wy-body-for-nav" role="document">
- <div class="wy-grid-for-nav">
-
- <nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
- <div class="wy-side-nav-search">
- <a href=".." class="icon icon-home"> The Yojik Server Installation Guide</a>
- <div role="search">
- <form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
- <input type="text" name="q" placeholder="Search docs" />
- </form>
- </div>
- </div>
- <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
- <ul class="current">
-
- <li>
- <li class="toctree-l1 ">
- <a class="" href="..">Home</a>
-
- </li>
- <li>
-
- <li>
- <li class="toctree-l1 ">
- <a class="" href="../1-un/">Installation d'un serveur Debian/Stretch sécurisé</a>
-
- </li>
- <li>
-
- <li>
- <li class="toctree-l1 ">
- <a class="" href="../2-deux/">Premières étapes de sécurisation du serveur</a>
-
- </li>
- <li>
-
- <li>
- <li class="toctree-l1 ">
- <a class="" href="../3-trois/">Configuration du réseau</a>
-
- </li>
- <li>
-
- <li>
- <li class="toctree-l1 ">
- <a class="" href="../4-quatre/">Installation d'un serveur de temps</a>
-
- </li>
- <li>
-
- <li>
- <li class="toctree-l1 ">
- <a class="" href="../5-cinq/">Installation d'un pare-feu</a>
-
- </li>
- <li>
-
- <li>
- <li class="toctree-l1 ">
- <a class="" href="../6-six/">Contrer les attaques de brute-force avec fail2ban</a>
-
- </li>
- <li>
-
- <li>
- <li class="toctree-l1 ">
- <a class="" href="../7-sept/">Installation d'un serveur de courrier basique</a>
-
- </li>
- <li>
-
- <li>
- <li class="toctree-l1 ">
- <a class="" href="../8-huit/">Installation du serveur DNS</a>
-
- </li>
- <li>
-
- <li>
- <li class="toctree-l1 ">
- <a class="" href="../9-neuf/">Installation d'un serveur web</a>
-
- </li>
- <li>
-
- <li>
- <li class="toctree-l1 ">
- <a class="" href="../10-dix/">Installation de dovecot et de l'authentification</a>
-
- </li>
- <li>
-
- <li>
- <li class="toctree-l1 current">
- <a class="current" href="./">Installation des certificats letsencrypt</a>
-
- <ul>
-
- <li class="toctree-l3"><a href="#lancement-du-programme-certbot">lancement du programme certbot</a></li>
-
-
- <li class="toctree-l3"><a href="#how-would-you-like-to-authenticate-with-the-acme-ca">How would you like to authenticate with the ACME CA?</a></li>
-
-
- </ul>
-
- </li>
- <li>
-
- <li>
- <li class="toctree-l1 ">
- <a class="" href="../12-douze/">Ajout des enregistrements SPF et DKIM au fichier de zone DNS</a>
-
- </li>
- <li>
-
- <li>
- <li class="toctree-l1 ">
- <a class="" href="../17-dixsept/">Installation de programmes de surveillance du serveur</a>
-
- </li>
- <li>
-
- <li>
- <li class="toctree-l1 ">
- <a class="" href="../18-dixhuit/">Installation d'un webmail</a>
-
- </li>
- <li>
-
- <li>
- <li class="toctree-l1 ">
- <a class="" href="../19-dixneuf/">Installation de git et de gogs</a>
-
- </li>
- <li>
-
- </ul>
- </div>
-
- </nav>
- <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
-
- <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
- <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
- <a href="..">The Yojik Server Installation Guide</a>
- </nav>
-
- <div class="wy-nav-content">
- <div class="rst-content">
- <div role="navigation" aria-label="breadcrumbs navigation">
- <ul class="wy-breadcrumbs">
- <li><a href="..">Docs</a> »</li>
-
-
-
- <li>Installation des certificats letsencrypt</li>
- <li class="wy-breadcrumbs-aside">
-
- </li>
- </ul>
- <hr/>
- </div>
- <div role="main">
- <div class="section">
-
- <p>## Installation des certificats letsencrypt</p>
- <hr />
- <pre><code>root@aijan:/home/ericadmin/bin# apt install certbot python-certbot-apache
- Lecture des listes de paquets... Fait
- Construction de l'arbre des dépendances
- Lecture des informations d'état... Fait
- The following additional packages will be installed:
- augeas-lenses libaugeas0 python-acme python-augeas python-certbot python-cffi-backend python-chardet python-configargparse python-configobj python-cryptography
- python-dnspython python-enum34 python-funcsigs python-idna python-ipaddress python-mock python-openssl python-parsedatetime python-pbr python-pkg-resources python-psutil
- python-pyasn1 python-pyicu python-requests python-rfc3339 python-setuptools python-six python-tz python-urllib3 python-zope.component python-zope.event
- python-zope.hookable python-zope.interface
- ...
- </code></pre>
- <hr />
- <p>Bien, les programmes sont installés. Nous allons créer des certificats pour les zones suivantes, après avoir créé les hôtes virtuels apache.</p>
- <blockquote>
- <p>yojik.net</p>
- <p>www.yojik.net</p>
- <p>atom.yojik.net</p>
- </blockquote>
- <p>Les 2 premiers concernent le site web, le dernier, le serveur de mail. Nous allons d'abord rajouter les noms manquants dans le fichier de zone DNS; pour l'instant, nous n'avons déclaré qu'un seul nom: aijan.yojik.net. Rajoutons les suivants avec des enregistrements CNAME. Ne pas oublier d'incrémenter le compteur situé dans le fichier de zone DNS après chaque modification.</p>
- <p>Nous ajoutons ici la référence du serveur web, avec un enregistrement CNAME: www.yojik.eu</p>
- <hr />
- <pre><code>www IN CNAME aijan.yojik.net.
- </code></pre>
- <hr />
- <p>Relecture des fichiers de configuration par bind:</p>
- <hr />
- <pre><code>root@aijan:/home/ericadmin# service bind9 reload
- </code></pre>
- <hr />
- <h3 id="lancement-du-programme-certbot">lancement du programme certbot</h3>
- <blockquote>
- <p>certbot --apache</p>
- </blockquote>
- <hr />
- <pre><code>root@aijan:/home/ericadmin# certbot --apache
- Saving debug log to /var/log/letsencrypt/letsencrypt.log
- Which names would you like to activate HTTPS for?
- -------------------------------------------------------------------------------
- 1: yojik.net
- 2: www.yojik.net
- -------------------------------------------------------------------------------
- Select the appropriate numbers separated by commas and/or spaces, or leave input
- blank to select all options shown (Enter 'c' to cancel):1 2
- Obtaining a new certificate
- Performing the following challenges:
- Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA.
- Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA.
- </code></pre>
- <hr />
- <p>Bon, il y a un problème ... après recherche sur le web, il se trouve que le programme certbot de Debian/stretch n'est pas à jour (modification due à un problème de sécurité.) (lien: https://community.letsencrypt.org/t/solution-client-with-the-currently-selected-authenticator-does-not-support-any-combination-of-challenges-that-will-satisfy-the-ca/49983)</p>
- <p>Il nous faut ajouter dans /etc/sources.list le dépot <strong>backports</strong> pour obtenir le fichier qui suit:
- (lien: https://backports.debian.org/Instructions/)</p>
- <hr />
- <pre><code>root@aijan:/home/ericadmin# cat /etc/apt/sources.list
- #
- # deb cdrom:[Debian GNU/Linux 9.3.0 _Stretch_ - Official amd64 NETINST 20171209-12:10]/ stretch main
- #deb cdrom:[Debian GNU/Linux 9.3.0 _Stretch_ - Official amd64 NETINST 20171209-12:10]/ stretch main
- deb http://deb.debian.org/debian/ stretch main contrib non-free
- deb-src http://deb.debian.org/debian/ stretch main contrib non-free
- deb http://security.debian.org/debian-security stretch/updates main contrib non-free
- deb-src http://security.debian.org/debian-security stretch/updates main contrib non-free
- # stretch-updates, previously known as 'volatile'
- deb http://deb.debian.org/debian/ stretch-updates main contrib non-free
- deb-src http://deb.debian.org/debian/ stretch-updates main contrib non-free
- deb http://ftp.debian.org/debian stretch-backports main contrib non-free
- </code></pre>
- <hr />
- <p>Notez la dernière ligne rajoutée au fichier. Ensuite,entrez les commandes suivantes:</p>
- <blockquote>
- <p>apt update
- apt-get install python-certbot-apache -t stretch-backports</p>
- </blockquote>
- <p>Un grand nombre de paquets vont être installés ...</p>
- <p>On relance le programme certbot:</p>
- <blockquote>
- <p>certbot --apache</p>
- </blockquote>
- <p>Cette fois-ci, ça fonctionne.</p>
- <hr />
- <pre><code>root@aijan:/home/ericadmin# certbot --apache
- Saving debug log to /var/log/letsencrypt/letsencrypt.log
- Plugins selected: Authenticator apache, Installer apache
- Which names would you like to activate HTTPS for?
- -------------------------------------------------------------------------------
- 1: yojik.net
- 2: www.yojik.net
- -------------------------------------------------------------------------------
- Select the appropriate numbers separated by commas and/or spaces, or leave input
- blank to select all options shown (Enter 'c' to cancel): 1
- Obtaining a new certificate
- Performing the following challenges:
- http-01 challenge for yojik.net
- Waiting for verification...
- Cleaning up challenges
- Created an SSL vhost at /etc/apache2/sites-available/yojiknet-le-ssl.conf
- Deploying Certificate to VirtualHost /etc/apache2/sites-available/yojiknet-le-ssl.conf
- Enabling available site: /etc/apache2/sites-available/yojiknet-le-ssl.conf
- Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- -------------------------------------------------------------------------------
- 1: No redirect - Make no further changes to the webserver configuration.
- 2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
- new sites, or if you're confident your site works on HTTPS. You can undo this
- change by editing your web server's configuration.
- -------------------------------------------------------------------------------
- Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
- Redirecting vhost in /etc/apache2/sites-enabled/yojiknet.conf to ssl vhost in /etc/apache2/sites-available/yojiknet-le-ssl.conf
- -------------------------------------------------------------------------------
- Congratulations! You have successfully enabled https://yojik.net
- You should test your configuration at:
- https://www.ssllabs.com/ssltest/analyze.html?d=yojik.net
- -------------------------------------------------------------------------------
- IMPORTANT NOTES:
- - Congratulations! Your certificate and chain have been saved at:
- /etc/letsencrypt/live/yojik.net/fullchain.pem
- Your key file has been saved at:
- /etc/letsencrypt/live/yojik.net/privkey.pem
- Your cert will expire on 2018-08-19. To obtain a new or tweaked
- version of this certificate in the future, simply run certbot again
- with the "certonly" option. To non-interactively renew *all* of
- your certificates, run "certbot renew"
- - If you like Certbot, please consider supporting our work by:
- Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
- Donating to EFF: https://eff.org/donate-le
- root@aijan:/home/ericadmin#
- </code></pre>
- <hr />
- <p>On retape les mêmes commandes pour générer les certificats pour le domaine <strong>www.yojik.net</strong>.</p>
- <p>Testez votre configuration comme indiqué ci-dessus. Vous devez obtenir une note <strong>A</strong>.</p>
- <p>Il nous faut maintenant créer un certificat pour notre serveur mail:</p>
- <hr />
- <p>``root@aijan:/home/ericadmin# certbot certonly -d aijan.yojik.net
- Saving debug log to /var/log/letsencrypt/letsencrypt.log</p>
- <h2 id="how-would-you-like-to-authenticate-with-the-acme-ca">How would you like to authenticate with the ACME CA?</h2>
- <p>1: Apache Web Server plugin - Beta (apache)
- 2: Spin up a temporary webserver (standalone)
- 3: Place files in webroot directory (webroot)</p>
- <hr />
- <p>Select the appropriate number [1-3] then [enter] (press 'c' to cancel): 1
- Plugins selected: Authenticator apache, Installer None
- Obtaining a new certificate
- Performing the following challenges:
- http-01 challenge for aijan.yojik.net
- Waiting for verification...
- Cleaning up challenges</p>
- <p>IMPORTANT NOTES:
- - Congratulations! Your certificate and chain have been saved at:
- /etc/letsencrypt/live/aijan.yojik.net/fullchain.pem
- Your key file has been saved at:
- /etc/letsencrypt/live/aijan.yojik.net/privkey.pem
- Your cert will expire on 2018-08-19. To obtain a new or tweaked
- version of this certificate in the future, simply run certbot
- again. To non-interactively renew <em>all</em> of your certificates, run
- "certbot renew"
- - If you like Certbot, please consider supporting our work by:</p>
- <p>Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
- Donating to EFF: https://eff.org/donate-le</p>
- <p>root@aijan:/home/ericadmin#
- `</p>
- <p>```</p>
- <hr />
- <p>Voilà, le certificat est créé.</p>
-
- </div>
- </div>
- <footer>
-
- <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
-
- <a href="../12-douze/" class="btn btn-neutral float-right" title="Ajout des enregistrements SPF et DKIM au fichier de zone DNS">Next <span class="icon icon-circle-arrow-right"></span></a>
-
-
- <a href="../10-dix/" class="btn btn-neutral" title="Installation de dovecot et de l'authentification"><span class="icon icon-circle-arrow-left"></span> Previous</a>
-
- </div>
-
- <hr/>
- <div role="contentinfo">
- <!-- Copyright etc -->
-
- </div>
- Built with <a href="http://www.mkdocs.org">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
- </footer>
-
- </div>
- </div>
- </section>
- </div>
- <div class="rst-versions" role="note" style="cursor: pointer">
- <span class="rst-current-version" data-toggle="rst-current-version">
-
-
- <span><a href="../10-dix/" style="color: #fcfcfc;">« Previous</a></span>
-
-
- <span style="margin-left: 15px"><a href="../12-douze/" style="color: #fcfcfc">Next »</a></span>
-
- </span>
- </div>
- </body>
- </html>
|