Re: Let's Encrypt et Apache2
Salut,
> Je cherche à configurer Let's Encrypt pour plusieurs domaines, sur Apache2.
>
> - Première question : Faut t'il créer 1 ou 2 certificat, pour
> WWW.Domain.TLD et Domain.TLD ?
tu peux créer un certificat pour plusieurs sous-domaines en même temps :
domain.tld, mail.domain.tld, ww1.domain.tld, ww2.domain.tld, etc
J'en ai fait au moins 6 comme ça :-) (Ne pas oublier le mail pour l'échange
en TLS.
>
> - Deuxième question : Apache2, par défaut, permet t'il bien de rediriger
> http vers https, sans avoir a modifier la configuration de https ?
Pour Apache, dans le(s) vHost(s), tu fais une redirection du ServerName
sous le port 80 vers le ServerName sous le port 443 (par exemple) :
<VirtualHost *:80>
ServerName www.example.com
ServerAdmin webmaster@localhost
RewriteEngine on
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
# Protocols h2 http/1.1
ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
SSLProtocol all -SSLv2 -SSLv3
SSLCipherSuite ALL:!aNULL:RC4+RSA:+HIGH:+MEDIUM:+LOW:+EXP:+eNULL
SSLHonorCipherOrder on
SSLCompression off
SSLOptions +StrictRequire
Header always set Strict-Transport-Security "max-age=31536000;"
</VirtualHost>
</IfModule>
Un problème cependant si tu veux activer le HTTP2 pour l'instant, il faut utiliser une
passerelle CGI pour PHP (php7.0-fpm) et remplacer le mpm_prefork_module par un
autre, qui soit compatible.
Bonne pioche,
Ph. Gras
Reply to: