文書の過去の版を表示しています。
$ sudo yum install epel-release
$ sudo yum install -y certbot python-certbot-apache
# 何も指定しない場合、ドメインを選択肢から選ぶ
$ sudo certbot
# 予めドメインを指定して、実行する場合
$ sudo certbot certonly --webroot -w /var/www/aaaa-test.tk -d aaaa-test.tk
$ sudo ls -la /etc/httpd/conf.d/
$ sudoedit /etc/httpd/conf.d/vhost-le-ssl.conf
$ sudo ls -la /etc/letsencrypt/live/www.aaaa-test.tk/
# CN= の後ろがサーバ名と同じか確認
$ openssl x509 -in /etc/letsencrypt/archive/www.aaaa-test.tk/fullchain1.pem -noout -subject
# バーチャルホストの設定を確認
$ sudoedit /etc/httpd/conf.d/vhost.conf
# ssl用のバーチャルホストを設定
$ sudoedit /etc/httpd/conf.d/vhost-le-ssl.conf
# logファイルに prefix「ssl_」をつける
# wwwのあり・なしの統一(なしの場合の例)
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.aaaa-test.tk
RewriteRule ^ https://aaaa-test.tk%{REQUEST_URI} [END,NE,R=permanent]
# 再起動
$ sudo apachectl restart
各アドレスにアクセスし、想定通りの動きをするか確認。
http://aaaa-test.tk/
http://www.aaaa-test.tk
https://aaaa-test.tk/
https://www.aaaa-test.tk/
コメント