質問編集履歴
2
apacheの設定を追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -50,6 +50,166 @@
|
|
50
50
|
|
51
51
|
|
52
52
|
|
53
|
+
apacheのsslの設定です。default-ssl.confをコピーしてキーのディレクトリとvhostを設定してます。
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
```conf
|
58
|
+
|
59
|
+
<IfModule mod_ssl.c>
|
60
|
+
|
61
|
+
<VirtualHost *:443>
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
DocumentRoot /var/www/html
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
|
70
|
+
|
71
|
+
# error, crit, alert, emerg.
|
72
|
+
|
73
|
+
# It is also possible to configure the loglevel for particular
|
74
|
+
|
75
|
+
# modules, e.g.
|
76
|
+
|
77
|
+
LogLevel info ssl:warn
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
ErrorLog ${APACHE_LOG_DIR}/error.log
|
82
|
+
|
83
|
+
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
SSLEngine on
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
SSLCertificateFile /etc/apache2/ssl/keys/server.pem
|
94
|
+
|
95
|
+
SSLCertificateKeyFile /etc/apache2/ssl/keys/server-key.pem
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
# Server Certificate Chain:
|
100
|
+
|
101
|
+
# Point SSLCertificateChainFile at a file containing the
|
102
|
+
|
103
|
+
# concatenation of PEM encoded CA certificates which form the
|
104
|
+
|
105
|
+
# certificate chain for the server certificate. Alternatively
|
106
|
+
|
107
|
+
# the referenced file can be the same as SSLCertificateFile
|
108
|
+
|
109
|
+
# when the CA certificates are directly appended to the server
|
110
|
+
|
111
|
+
# certificate for convinience.
|
112
|
+
|
113
|
+
#SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
# Certificate Authority (CA):
|
118
|
+
|
119
|
+
# Set the CA certificate verification path where to find CA
|
120
|
+
|
121
|
+
# certificates for client authentication or alternatively one
|
122
|
+
|
123
|
+
# huge file containing all of them (file must be PEM encoded)
|
124
|
+
|
125
|
+
# Note: Inside SSLCACertificatePath you need hash symlinks
|
126
|
+
|
127
|
+
# to point to the certificate files. Use the provided
|
128
|
+
|
129
|
+
# Makefile to update the hash symlinks after changes.
|
130
|
+
|
131
|
+
#SSLCACertificatePath /etc/ssl/certs/
|
132
|
+
|
133
|
+
#SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
# Certificate Revocation Lists (CRL):
|
138
|
+
|
139
|
+
# Set the CA revocation path where to find CA CRLs for client
|
140
|
+
|
141
|
+
# authentication or alternatively one huge file containing all
|
142
|
+
|
143
|
+
# of them (file must be PEM encoded)
|
144
|
+
|
145
|
+
# Note: Inside SSLCARevocationPath you need hash symlinks
|
146
|
+
|
147
|
+
# to point to the certificate files. Use the provided
|
148
|
+
|
149
|
+
# Makefile to update the hash symlinks after changes.
|
150
|
+
|
151
|
+
#SSLCARevocationPath /etc/apache2/ssl.crl/
|
152
|
+
|
153
|
+
#SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
# Client Authentication (Type):
|
158
|
+
|
159
|
+
# Client certificate verification type and depth. Types are
|
160
|
+
|
161
|
+
# none, optional, require and optional_no_ca. Depth is a
|
162
|
+
|
163
|
+
# number which specifies how deeply to verify the certificate
|
164
|
+
|
165
|
+
# issuer chain before deciding the certificate is not valid.
|
166
|
+
|
167
|
+
#SSLVerifyClient require
|
168
|
+
|
169
|
+
#SSLVerifyDepth 10
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
<FilesMatch ".(cgi|shtml|phtml|php)$">
|
176
|
+
|
177
|
+
SSLOptions +StdEnvVars
|
178
|
+
|
179
|
+
</FilesMatch>
|
180
|
+
|
181
|
+
<Directory /usr/lib/cgi-bin>
|
182
|
+
|
183
|
+
SSLOptions +StdEnvVars
|
184
|
+
|
185
|
+
</Directory>
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
ServerName localhost
|
192
|
+
|
193
|
+
ServerAlias *.localhost
|
194
|
+
|
195
|
+
VirtualDocumentRoot "/var/www/html/%1"
|
196
|
+
|
197
|
+
<Directory "/var/www/html">
|
198
|
+
|
199
|
+
AllowOverride All
|
200
|
+
|
201
|
+
</Directory>
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
</VirtualHost>
|
206
|
+
|
207
|
+
</IfModule>
|
208
|
+
|
209
|
+
```
|
210
|
+
|
211
|
+
|
212
|
+
|
53
213
|
こちらの環境を使っています(ステマじゃないよ)
|
54
214
|
|
55
215
|
https://github.com/Diwamoto/docker-lamp
|
1
test
CHANGED
File without changes
|
test
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
-
|
5
|
+
dockerでphp+apache+mysql+mailhogなローカル環境を作り動かしていて、virtualhostで複数サイトを同時に起動できるようにしています。
|
6
6
|
|
7
|
-
|
7
|
+
ふとローカル環境をssl化したいと思い、mkcertでワイルドカード証明書を作り動かしたところどうしてもchromeに怒られてしまいます。
|
8
8
|
|
9
|
-
|
9
|
+
apacheの設定はデフォルトの設定をコピーし、crtとkeyファイルのパスを自分で作ってコンテナにコピーした証明書で作っています。
|
10
10
|
|
11
11
|
|
12
12
|
|
@@ -14,11 +14,7 @@
|
|
14
14
|
|
15
15
|
|
16
16
|
|
17
|
-
```
|
18
|
-
|
19
|
-
|
17
|
+
特定のドメインのみ(aaa.localhost)だとうまくいくが、*.localhostで証明書を作るとcommonnameerrorが発生する
|
20
|
-
|
21
|
-
```
|
22
18
|
|
23
19
|
|
24
20
|
|
@@ -26,11 +22,13 @@
|
|
26
22
|
|
27
23
|
|
28
24
|
|
29
|
-
```
|
25
|
+
```bash
|
30
26
|
|
31
|
-
|
27
|
+
mkcert "*.localhost"
|
32
28
|
|
33
29
|
```
|
30
|
+
|
31
|
+
したものをserver.crtとserver.keyにリネームして使っています
|
34
32
|
|
35
33
|
|
36
34
|
|
@@ -38,7 +36,13 @@
|
|
38
36
|
|
39
37
|
|
40
38
|
|
39
|
+
ネットで「openssl chromeに怒られない ワイルドカード」等で検索し、出てきたものを使って実行したりしてみた
|
40
|
+
|
41
|
-
|
41
|
+
特定ドメインだと動くので、apacheの設定はおかしくないと思う
|
42
|
+
|
43
|
+
せっかくmampからdockerに乗り換え、vhostの設定をいちいち書かなくていいようにしたのに、sslのためにまた一つ一つ書くのが面倒
|
44
|
+
|
45
|
+
|
42
46
|
|
43
47
|
|
44
48
|
|
@@ -46,4 +50,6 @@
|
|
46
50
|
|
47
51
|
|
48
52
|
|
49
|
-
こ
|
53
|
+
こちらの環境を使っています(ステマじゃないよ)
|
54
|
+
|
55
|
+
https://github.com/Diwamoto/docker-lamp
|