GTUTO
https://www.gtuto.com/https-sur-apache/
Export date: Sat Apr 27 3:08:08 2024 / +0000 GMT

HTTPS sur Apache


Mise à jour, nouvelle méthode


apt-get install python-certbot-apache -t jessie-backports

certbot --apache



certbot --apache certonly seulement si la conf SSL apache est manuelle

https://certbot.eff.org 1

//************************


encore mieux passe tout les virtual host d'un coup

wget https://dl.eff.org/certbot-auto

chmod a+x certbot-auto

./certbot-auto --apache  -> répondre au questions


//************************


https://www.ssllabs.com/ssltest/analyze.html?d=www.mondomaine.com -> tester la conf HTTPS




Passer un site web apache en HTTPS avec certificat valide et certifié, mais gratuit

Certificat gratuit avec http://letsencrypt.fr/ 2

sur Debian

apt-get install -y git

cd /monchemein

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

./letsencrypt-auto certonly --webroot --webroot-path /home/www.mondomaine.com --renew-by-default --email adresse@email_valide.com --agree-tos -d www.mondomaine.com

Dans le fichier de conf apache pour le domaine, ajouter les 4 lignes à la fin de cet exemple

<VirtualHost *:443>    

  DocumentRoot /home/www.mondomaine.com/  

  ServerName www.mondomaine.com   

  ServerAdmin adresse@email_valide.com    

  <Directory /home/www.mondomaine.com/>       

    Options FollowSymLinks       

    AllowOverride all       

    #AllowOverride Indexes     AuthConfig Limit FileInfo       

    Order allow,deny        

    Allow from all   

  </Directory>    

  AddType application/x-httpd-php .php .php3 .php4 .php5     

  SSLEngine on  

  SSLCertificateFile /etc/letsencrypt/live/www.mondomaine.com/cert.pem   

  SSLCertificateKeyFile /etc/letsencrypt/live/www.mondomaine.com/privkey.pem   

  SSLCACertificateFile /etc/letsencrypt/live/www.mondomaine.com/chain.pem

  </VirtualHost>

/etc/init.d/apache2 stop

/etc/init.d/apache2 start

Le certificat doit être renouvelé tous les mois -> cron création /etc/cron.monthly/letsencrypt +chmod +x /etc/cron.monthly/letsencrypt contenant :

#!/bin/bash /monchemin/letsencrypt/letsencrypt-auto certonly --webroot --webroot-path /home/www.mondomaine.com --renew-by-default --emailadresse@email_valide.com  --agree-tos -d www.mondomaine.com

/etc/init.d/apache2 restart

C'est tout



Ancienne méthode pour certificat auto-signés -> message sécurité sur le navigateur


a2enmod ssl

service apache2 force-reload  ou /etc/init.d/apache2 stop + /etc/init.d/apache2 start

make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/ssl/private/localhost.pem

ou

openssl req -x509 -nodes -days 365 -newkey rsa:1024 -out /etc/apache2/server.crt -keyout /etc/apache2/server.key

openssl req -sha256 -nodes -newkey rsa:2048 -keyout www.server.com.key -out www.server.com.csr


ou Certificats gratuits : https://www.startssl.com/ 3


Controle certificat SSL openssl s_client -connect localhost:443


En cas e conflict de version :  mv /opt/eff.org  /opt/eff.org.001

Links:
  1. https://certbot.eff.org
  2. http://letsencrypt.fr/
  3. https://www.startssl.com/
Post date: 2016-11-04 15:38:17
Post date GMT: 2016-11-04 15:38:17

Post modified date: 2017-12-29 11:35:03
Post modified date GMT: 2017-12-29 11:35:03

Export date: Sat Apr 27 3:08:08 2024 / +0000 GMT
This page was exported from GTUTO [ https://www.gtuto.com ]
Export of Post and Page has been powered by [ Universal Post Manager ] plugin from www.ProfProjects.com