回答編集履歴
1
内容の詳細記入
test
CHANGED
@@ -1,43 +1,145 @@
|
|
1
|
-
結局、当初の方法を断念致しました。
|
1
|
+
結局、当初の方法を断念し、下記URLを参考にしてそれぞれ対応致しました。
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
-
|
5
|
+
# 1. https化
|
6
|
+
|
7
|
+
[Bitnami wordpressをLet’s Encryptを使って無料でSSL化【AWS】](https://www.moor-triangle.com/2017/02/01/%E3%80%90aws%E3%80%91bitnami-wordpress%E3%82%92lets-encrypt%E3%82%92%E4%BD%BF%E3%81%A3%E3%81%A6%E7%84%A1%E6%96%99%E3%81%A7ssl%E5%8C%96/)
|
8
|
+
|
9
|
+
まず、上記でhttps化を行いました。 ※念のためリンク先の内容をザッと転記します。
|
6
10
|
|
7
11
|
|
8
12
|
|
9
|
-
1.
|
13
|
+
1. Gitをインストール
|
10
14
|
|
11
|
-
|
15
|
+
`sudo apt-get install libcurl4-gnutls-dev libexpat1-dev gettext`
|
12
16
|
|
17
|
+
`sudo apt-get install git`
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
2. Let’s Encryptのインストール
|
22
|
+
|
23
|
+
`cd 任意のディレクトリ` (Let’s Encryptの展開場所)
|
24
|
+
|
25
|
+
`git clone https://github.com/letsencrypt/letsencrypt`
|
26
|
+
|
27
|
+
`cd letsencrypt`
|
28
|
+
|
29
|
+
`./letsencrypt-auto --help`
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
3. Let’s EncryptでSSL証明書を発行
|
34
|
+
|
35
|
+
`./letsencrypt-auto certonly -a standalone -d <証明書を取得したいドメイン>`
|
36
|
+
|
37
|
+
Congratulations!とでればSSL証明書の発行成功。
|
38
|
+
|
39
|
+
※以下のエラーが出た場合はApacheを一度停止してから再度コマンドを実行。
|
40
|
+
|
41
|
+
sudo /opt/bitnami/ctlscript.sh stop apache
|
42
|
+
|
43
|
+
At least one of the (possibly) required ports is already taken.
|
44
|
+
|
45
|
+
<生成した証明書の確認>
|
46
|
+
|
47
|
+
`sudo ls /etc/letsencrypt/live/<domain>`
|
48
|
+
|
49
|
+
4. Apacheでhttps通信を有効化
|
50
|
+
|
51
|
+
* /opt/bitnami/apache2/conf/httpd.confの下記コメントアウトを外す
|
52
|
+
|
53
|
+
`Include conf/extra/httpd-ssl.conf`
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
* /opt/bitnami/apache2/conf/extra/httpd-ssl.confの編集
|
58
|
+
|
59
|
+
※発行した証明書のパスを指定
|
60
|
+
|
61
|
+
SSLCertificateFile "/etc/letsencrypt/live/<domain>/cert.pem"
|
62
|
+
|
63
|
+
SSLCertificateKeyFile "/etc/letsencrypt/live/<domain>/privkey.pem"
|
64
|
+
|
65
|
+
SSLCertificateChainFile "/etc/letsencrypt/live/<domain>/chain.pem"
|
66
|
+
|
67
|
+
元の設定はコメントアウトするか削除する
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
* /opt/bitnami/apache2/conf/bitnami/bitnami.confの編集
|
72
|
+
|
73
|
+
`<IfModule mod_rewrite.c>`
|
74
|
+
|
75
|
+
`RewriteEngine On`
|
76
|
+
|
77
|
+
`RewriteCond %{HTTPS} !=on`
|
78
|
+
|
79
|
+
`RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]`
|
80
|
+
|
81
|
+
`</IfModule>`
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
↓からファイルの最終行まですべてコメントアウト
|
88
|
+
|
89
|
+
`Default SSL Virtual Host configuration`
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
* /opt/bitnami/apache2/conf/extra/httpd-ssl.confの編集
|
94
|
+
|
95
|
+
`</VirtualHost>`
|
96
|
+
|
97
|
+
↓
|
98
|
+
|
99
|
+
`Include "/opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf"`
|
100
|
+
|
101
|
+
`</VirtualHost>`
|
102
|
+
|
103
|
+
`Include "/opt/bitnami/apache2/conf/bitnami/bitnami-apps-vhosts.conf"`
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
13
|
-
|
109
|
+
これでhttps通信が有効化となる。
|
110
|
+
|
111
|
+
但し、httpからのリダイレクトが完了していない状態。
|
14
112
|
|
15
113
|
|
16
114
|
|
17
115
|
|
18
116
|
|
19
|
-
2
|
117
|
+
* /opt/bitnami/apache2/conf/extra/httpd-ssl.confの編集
|
20
118
|
|
119
|
+
`<VirtualHost _default_:443>`
|
120
|
+
|
21
|
-
|
121
|
+
`Header set Strict-Transport-Security "max-age=315360000; includeSubDomains"`
|
122
|
+
|
123
|
+
※この2行を追加
|
22
124
|
|
23
125
|
|
24
126
|
|
127
|
+
* Apacheの再起動
|
128
|
+
|
25
|
-
|
129
|
+
`sudo service httpd restart`
|
130
|
+
|
131
|
+
|
26
132
|
|
27
133
|
|
28
134
|
|
135
|
+
# 2.WordPressのデータベース置換
|
29
136
|
|
137
|
+
[【リス様】WordPressのデータベース置換プラグインといえばSearch Regex](https://website-homepage.com/wordpress/plugin/manage/search-regex)
|
30
138
|
|
31
|
-
|
139
|
+
|
32
140
|
|
33
|
-
一
|
141
|
+
続いて、上記でサイト内にあるデータの一括https置換を行いました。
|
34
142
|
|
35
|
-
ヘッダーのロゴ画像だけhttpsに置換されていなかったりしましたので、
|
143
|
+
一部ページでhttpのままだったりしましたが、ヘッダーのロゴ画像だけhttpsに置換されていなかったりしましたので、
|
36
144
|
|
37
|
-
該当の画像を設定している場所をWordpressの管理コンソールから探し、直接変更する事で解消しました。
|
145
|
+
該当の画像を設定している場所をWordpressの管理コンソールから探し、直接変更する事で解消しました。
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
ここに載せた情報がどなたかのお役に立てば幸いです。
|