質問編集履歴
2
コードを追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -22,4 +22,66 @@
|
|
22
22
|
https://lightsail.aws.amazon.com/ls/docs/ja_jp/articles/amazon-lightsail-using-lets-encrypt-certificates-with-lamp
|
23
23
|
|
24
24
|
前提条件のところですが、
|
25
|
-
LAMP インスタンスを作成して、取得したドメイン
|
25
|
+
LAMP インスタンスを作成して、取得したドメインでDNS レコード(Aレコード)を登録しております。
|
26
|
+
|
27
|
+
■/opt/bitnami/apache/conf/bitnami/bitnami-ssl.conf
|
28
|
+
```
|
29
|
+
# Default SSL Virtual Host configuration.
|
30
|
+
|
31
|
+
<IfModule !ssl_module>
|
32
|
+
LoadModule ssl_module modules/mod_ssl.so
|
33
|
+
</IfModule>
|
34
|
+
|
35
|
+
Listen 443
|
36
|
+
SSLProtocol all -SSLv2 -SSLv3
|
37
|
+
SSLHonorCipherOrder on
|
38
|
+
SSLCipherSuite "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS !EDH !RC4"
|
39
|
+
SSLPassPhraseDialog builtin
|
40
|
+
SSLSessionCache "shmcb:/opt/bitnami/apache/logs/ssl_scache(512000)"
|
41
|
+
SSLSessionCacheTimeout 300
|
42
|
+
|
43
|
+
<VirtualHost _default_:443>
|
44
|
+
DocumentRoot "/opt/bitnami/apache2/htdocs/smartphone-coupon/public"
|
45
|
+
SSLEngine on
|
46
|
+
SSLCertificateFile "/etc/letsencrypt/live/sumachira.jp/cert.pem"
|
47
|
+
SSLCertificateKeyFile "/etc/letsencrypt/live/sumachira.jp/privkey.pem"
|
48
|
+
SSLCertificateChainFile "/etc/letsencrypt/live/sumachira.jp/chain.pem"
|
49
|
+
|
50
|
+
<Directory "/opt/bitnami/apache/htdocs">
|
51
|
+
Options Indexes FollowSymLinks
|
52
|
+
AllowOverride All
|
53
|
+
Require all granted
|
54
|
+
</Directory>
|
55
|
+
|
56
|
+
# Error Documents
|
57
|
+
ErrorDocument 503 /503.html
|
58
|
+
|
59
|
+
</VirtualHost>
|
60
|
+
```
|
61
|
+
|
62
|
+
■/opt/bitnami/apache2/conf/bitnami/bitnami.conf
|
63
|
+
(/opt/bitnami/apache/conf/bitnami/bitnami.confもあり、同じ内容です)
|
64
|
+
```
|
65
|
+
# Default Virtual Host configuration.
|
66
|
+
|
67
|
+
# Let Apache know we're behind a SSL reverse proxy
|
68
|
+
SetEnvIf X-Forwarded-Proto https HTTPS=on
|
69
|
+
|
70
|
+
<VirtualHost _default_:80>
|
71
|
+
DocumentRoot "/opt/bitnami/apache2/htdocs/smartphone-coupon/public"
|
72
|
+
RewriteEngine On
|
73
|
+
RewriteCond %{HTTPS} !=on
|
74
|
+
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]
|
75
|
+
<Directory "/opt/bitnami/apache2/htdocs/smartphone-coupon/public">
|
76
|
+
Options Indexes FollowSymLinks
|
77
|
+
AllowOverride All
|
78
|
+
Require all granted
|
79
|
+
</Directory>
|
80
|
+
|
81
|
+
# Error Documents
|
82
|
+
ErrorDocument 503 /503.html
|
83
|
+
|
84
|
+
</VirtualHost>
|
85
|
+
|
86
|
+
Include "/opt/bitnami/apache/conf/bitnami/bitnami-ssl.conf"
|
87
|
+
```
|
1
詳細な説明を追記しました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -8,12 +8,18 @@
|
|
8
8
|
原因を調べると
|
9
9
|
証明書のSAN(コモンネーム)とURLに入力したドメインが違うためでした。
|
10
10
|
|
11
|
+
下記参考サイトの「ステップ 3. Let Encrypt SSLワイルドカード証明書のリクエスト」のところで、
|
12
|
+
DOMAIN=sumachira.jp
|
13
|
+
コマンドを実行した後に
|
14
|
+
sudo certbot -d $DOMAIN -d $WILDCARD --manual --preferred-challenges dns certonly
|
11
|
-
|
15
|
+
を実行して登録したドメインを指定しましたが、
|
12
|
-
どこでSANの指定ができるのか教えていただけないでしょうか。
|
13
16
|
|
14
|
-
|
17
|
+
https://sumachira.jp/にアクセスして、URLの左横にある「保護されていない通信」をクリック → 「証明書」をクリックしてコモンネームを確認したところ、
|
15
18
|
ip-172-26-9-204.ap-northeast-1.compute.internal
|
16
|
-
となっていま
|
19
|
+
となっていました。
|
17
20
|
|
18
21
|
■参考サイト
|
19
|
-
https://lightsail.aws.amazon.com/ls/docs/ja_jp/articles/amazon-lightsail-using-lets-encrypt-certificates-with-lamp
|
22
|
+
https://lightsail.aws.amazon.com/ls/docs/ja_jp/articles/amazon-lightsail-using-lets-encrypt-certificates-with-lamp
|
23
|
+
|
24
|
+
前提条件のところですが、
|
25
|
+
LAMP インスタンスを作成して、取得したドメイン(sumachira.jp)でDNS レコード(Aレコード)を登録しております。
|