yum repolist all | grep -i epel
Apache2.4をインストールした際に、デフォルトで有効になっているとは思いますが、
Apacheのssl_module
が有効になっているか確認します。
httpd -M | grep ssl_module
yum install certbot python2-certbot-apache
vim /etc/httpd/conf/httpd.conf
末尾に以下を追加します
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html
ServerName junpeko.work
RewriteEngine on
RewriteCond %{SERVER_NAME} =junpeko.test
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
certbot --apache -d junpeko.test
ドキュメント https://certbot.eff.org/lets-encrypt/centosrhel7-apacheを確認すると、
python2-certbot-apache
ではなくsnap
というパッケージを利用してSSLを適用するのが推奨のようです。
次回はこちらでやりたいと思います。