質問編集履歴

3

追記

2019/04/02 13:37

投稿

yuudai
yuudai

スコア65

test CHANGED
File without changes
test CHANGED
@@ -17,3 +17,387 @@
17
17
  apacheのversionは2.4.6です。
18
18
 
19
19
  どなたか助けてください。よろしくお願いします。
20
+
21
+ ```
22
+
23
+ # When we also provide SSL we have to listen to the
24
+
25
+ # the HTTPS port in addition.
26
+
27
+ #
28
+
29
+ Listen 443
30
+
31
+
32
+
33
+ ##
34
+
35
+ ## SSL Global Context
36
+
37
+ ##
38
+
39
+ ## All SSL configuration in this context applies both to
40
+
41
+ ## the main server and all SSL-enabled virtual hosts.
42
+
43
+ ##
44
+
45
+
46
+
47
+ # Pass Phrase Dialog:
48
+
49
+ # Configure the pass phrase gathering process.
50
+
51
+ # The filtering dialog program (`builtin' is a internal
52
+
53
+ # terminal dialog) has to provide the pass phrase on stdout.
54
+
55
+ SSLPassPhraseDialog exec:/usr/libexec/httpd-ssl-pass-dialog
56
+
57
+
58
+
59
+ # Inter-Process Session Cache:
60
+
61
+ # Configure the SSL Session Cache: First the mechanism
62
+
63
+ # to use and second the expiring timeout (in seconds).
64
+
65
+ SSLSessionCache shmcb:/run/httpd/sslcache(512000)
66
+
67
+ SSLSessionCacheTimeout 300
68
+
69
+
70
+
71
+ # Pseudo Random Number Generator (PRNG):
72
+
73
+ # Configure one or more sources to seed the PRNG of the
74
+
75
+ # SSL library. The seed data should be of good random quality.
76
+
77
+ # WARNING! On some platforms /dev/random blocks if not enough entropy
78
+
79
+ # is available. This means you then cannot use the /dev/random device
80
+
81
+ # because it would lead to very long connection times (as long as
82
+
83
+ # it requires to make more entropy available). But usually those
84
+
85
+ # platforms additionally provide a /dev/urandom device which doesn't
86
+
87
+ # block. So, if available, use this one instead. Read the mod_ssl User
88
+
89
+ # Manual for more details.
90
+
91
+ SSLRandomSeed startup file:/dev/urandom 256
92
+
93
+ SSLRandomSeed connect builtin
94
+
95
+ #SSLRandomSeed startup file:/dev/random 512
96
+
97
+ #SSLRandomSeed connect file:/dev/random 512
98
+
99
+ #SSLRandomSeed connect file:/dev/urandom 512
100
+
101
+ Use "SSLCryptoDevice" to enable any supported hardware
102
+
103
+ # accelerators. Use "openssl engine -v" to list supported
104
+
105
+ # engine names. NOTE: If you enable an accelerator and the
106
+
107
+ # server does not start, consult the error logs and ensure
108
+
109
+ # your accelerator is functioning properly.
110
+
111
+ #
112
+
113
+ SSLCryptoDevice builtin
114
+
115
+ #SSLCryptoDevice ubsec
116
+
117
+
118
+
119
+ ##
120
+
121
+ ## SSL Virtual Host Context
122
+
123
+ ##
124
+
125
+
126
+
127
+ <VirtualHost _default_:443>
128
+
129
+
130
+
131
+ # General setup for the virtual host, inherited from global configuration
132
+
133
+ #DocumentRoot "/var/www/html"
134
+
135
+ ServerName www.sample.com:443
136
+
137
+
138
+
139
+ # Use separate log files for the SSL virtual host; note that LogLevel
140
+
141
+ # is not inherited from httpd.conf.
142
+
143
+ ErrorLog logs/ssl_error_log
144
+
145
+ TransferLog logs/ssl_access_log
146
+
147
+ LogLevel warn
148
+
149
+
150
+
151
+ # SSL Engine Switch:
152
+
153
+ # Enable/Disable SSL for this virtual host.
154
+
155
+ SSLEngine on
156
+
157
+
158
+
159
+ # SSL Protocol support:
160
+
161
+ # List the enable protocol levels with which clients will be able to
162
+
163
+ # connect. Disable SSLv2 access by default:
164
+
165
+ SSLProtocol all -SSLv2 -SSLv3
166
+
167
+ # SSL Cipher Suite:
168
+
169
+ # List the ciphers that the client is permitted to negotiate.
170
+
171
+ # See the mod_ssl documentation for a complete list.
172
+
173
+ SSLCipherSuite HIGH:3DES:!aNULL:!MD5:!SEED:!IDEA
174
+
175
+
176
+
177
+ # Speed-optimized SSL Cipher configuration:
178
+
179
+ # If speed is your main concern (on busy HTTPS servers e.g.),
180
+
181
+ # you might want to force clients to specific, performance
182
+
183
+ # optimized ciphers. In this case, prepend those ciphers
184
+
185
+ # to the SSLCipherSuite list, and enable SSLHonorCipherOrder.
186
+
187
+ # Caveat: by giving precedence to RC4-SHA and AES128-SHA
188
+
189
+ # (as in the example below), most connections will no longer
190
+
191
+ # have perfect forward secrecy - if the server's key is
192
+
193
+ # compromised, captures of past or future traffic must be
194
+
195
+ # considered compromised, too.
196
+
197
+ #SSLCipherSuite RC4-SHA:AES128-SHA:HIGH:MEDIUM:!aNULL:!MD5
198
+
199
+ #SSLHonorCipherOrder on
200
+
201
+
202
+
203
+ # Server Certificate:
204
+
205
+ # Point SSLCertificateFile at a PEM encoded certificate. If
206
+
207
+ # the certificate is encrypted, then you will be prompted for a
208
+
209
+ # pass phrase. Note that a kill -HUP will prompt again. A new
210
+
211
+ # certificate can be generated using the genkey(1) command.
212
+
213
+ SSLCertificateFile /etc/pki/tls/certs/server.crt
214
+
215
+
216
+
217
+ # Server Private Key:
218
+
219
+ # If the key is not combined with the certificate, use this
220
+
221
+ # directive to point at the key file. Keep in mind that if
222
+
223
+ # you've both a RSA and a DSA private key you can configure
224
+
225
+ # both in parallel (to also allow the use of DSA ciphers, etc.)
226
+
227
+ SSLCertificateKeyFile /etc/pki/tls/private/server.key
228
+
229
+
230
+
231
+ # Server Certificate Chain:
232
+
233
+ # Point SSLCertificateChainFile at a file containing the
234
+
235
+ # concatenation of PEM encoded CA certificates which form the
236
+
237
+ # certificate chain for the server certificate. Alternatively
238
+
239
+ # the referenced file can be the same as SSLCertificateFile
240
+
241
+ # when the CA certificates are directly appended to the server
242
+
243
+ # certificate for convinience.
244
+
245
+ #SSLCertificateChainFile /etc/pki/tls/certs/server-chain.crt
246
+
247
+
248
+
249
+ # Certificate Authority (CA):
250
+
251
+ # Set the CA certificate verification path where to find CA
252
+
253
+ # certificates for client authentication or alternatively one
254
+
255
+ # huge file containing all of them (file must be PEM encoded)
256
+
257
+ SSLCACertificateFile /etc/pki/tls/certs/ca-bundle.crt
258
+
259
+
260
+
261
+ # Client Authentication (Type):
262
+
263
+ # Client certificate verification type and depth. Types are
264
+
265
+ # none, optional, require and optional_no_ca. Depth is a
266
+
267
+ # number which specifies how deeply to verify the certificate
268
+
269
+ # issuer chain before deciding the certificate is not valid.
270
+
271
+ #SSLVerifyClient require
272
+
273
+ #SSLVerifyDepth 10
274
+
275
+
276
+
277
+ # Access Control:
278
+
279
+ # With SSLRequire you can do per-directory access control based
280
+
281
+ # on arbitrary complex boolean expressions containing server
282
+
283
+ # variable checks and other lookup directives. The syntax is a
284
+
285
+ # mixture between C and Perl. See the mod_ssl documentation
286
+
287
+ # for more details.
288
+
289
+ #<Location />
290
+
291
+ #SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \
292
+
293
+ # and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
294
+
295
+ # and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
296
+
297
+ # and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
298
+
299
+ # and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20 ) \
300
+
301
+ # or %{REMOTE_ADDR} =~ m/^192.76.162.[0-9]+$/
302
+
303
+ </VirtualHost>
304
+
305
+
306
+
307
+ # SSL Engine Options:
308
+
309
+ # Set various options for the SSL engine.
310
+
311
+ # o FakeBasicAuth:
312
+
313
+ # Translate the client X.509 into a Basic Authorisation. This means that
314
+
315
+ # the standard Auth/DBMAuth methods can be used for access control. The
316
+
317
+ # user name is the `one line' version of the client's X.509 certificate.
318
+
319
+ # Note that no password is obtained from the user. Every entry in the user
320
+
321
+ # file needs this password: `xxj31ZMTZzkVA'.
322
+
323
+ # o ExportCertData:
324
+
325
+ # This exports two additional environment variables: SSL_CLIENT_CERT and
326
+
327
+ # SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
328
+
329
+ # server (always existing) and the client (only existing when client
330
+
331
+ # authentication is used). This can be used to import the certificates
332
+
333
+ # into CGI scripts.
334
+
335
+ # o StdEnvVars:
336
+
337
+ # This exports the standard SSL/TLS related `SSL_*' environment variables.
338
+
339
+ # Per default this exportation is switched off for performance reasons,
340
+
341
+ # because the extraction step is an expensive operation and is usually
342
+
343
+ # useless for serving static content. So one usually enables the
344
+
345
+ # exportation for CGI and SSI requests only.
346
+
347
+ # o StrictRequire:
348
+
349
+ # This denies access when "SSLRequireSSL" or "SSLRequire" applied even
350
+
351
+ # under a "Satisfy any" situation, i.e. when it applies access is denied
352
+
353
+ # and no other module can change it.
354
+
355
+ # o OptRenegotiate:
356
+
357
+ # This enables optimized SSL connection renegotiation handling when SSL
358
+
359
+ # directives are used in per-directory context.
360
+
361
+ #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
362
+
363
+ <Files ~ ".(cgi|shtml|phtml|php3?)$">
364
+
365
+ SSLOptions +StdEnvVars
366
+
367
+ </Files>
368
+
369
+ <Directory "/var/www/cgi-bin">
370
+
371
+ SSLOptions +StdEnvVars
372
+
373
+ </Directory>
374
+
375
+
376
+
377
+
378
+
379
+ BrowserMatch "MSIE [2-5]" \
380
+
381
+ nokeepalive ssl-unclean-shutdown \
382
+
383
+ downgrade-1.0 force-response-1.0
384
+
385
+
386
+
387
+ # Per-Server Logging:
388
+
389
+ # The home of a custom SSL log file. Use this when you want a
390
+
391
+ # compact non-error SSL logfile on a virtual host basis.
392
+
393
+ CustomLog logs/ssl_request_log \
394
+
395
+ "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
396
+
397
+
398
+
399
+ </Location>
400
+
401
+ ```
402
+
403
+ 文字数制限があったので、コメントアウトされている文章のようなモノは省きました。

2

修正

2019/04/02 13:37

投稿

yuudai
yuudai

スコア65

test CHANGED
File without changes
test CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  ```
14
14
 
15
- でEnter pass phrase for server.keyのところで適当に新しいパスワードを入力したら良いのかなと思い入力したらエラーが出てしまって別に問題なうなのでそのままにしています。
15
+ でEnter pass phrase for server.keyのところで適当に新しいパスワードを入力したら良いのかなと思い入力したらエラー?みたいなの出てしまったんですけどそのまま国や県を入力するところに進めたのでそのままにしています。
16
16
 
17
17
  apacheのversionは2.4.6です。
18
18
 

1

修正

2019/04/02 10:28

投稿

yuudai
yuudai

スコア65

test CHANGED
File without changes
test CHANGED
@@ -1,6 +1,6 @@
1
- オレオレ証明書を作ろうと思い[このサイト](http://cos.linux-dvr.biz/archives/tag/ssl)を見ながらやってたんですけど、/etc/httpd/conf.d/ssl.confの最終行を勘違いして書き換えてしまって元の文がわからなくなってしまいました。apacheを再起動しようとしたときにエラーが出てsystemctl status httpd.serviceを実行するとssl.confの最終行でsyntax errorが出ていることに気づきました。それに加えて、一度もいじってないのですが/etc/httpd/conf/httpd.confの最終行でもエラーが出ます。調べてもわからなかったので質問しました。
1
+ オレオレ証明書を作ろうと思い[このサイト](http://cos.linux-dvr.biz/archives/tag/ssl)を見ながらやってたんですけど、/etc/httpd/conf.d/ssl.confの最終行を勘違いして書き換えてしまって元の文がわからなくなってしまいました。apacheを再起動しようとしたときにエラーが出てsystemctl status httpd.serviceを実行するとssl.confの最終行でsyntax errorが出ていることに気づきました。それに加えて、一度もいじってないのですが/etc/httpd/conf/httpd.confの最終行でもsyntax errorが出ます。調べてもわからなかったので質問しました。
2
2
 
3
- ssl.confの中身は[このサイト](http://cos.linux-dvr.biz/archives/tag/ssl)で説明しているのと最終行以外全く同じです。最終行は最初間違えて</VirtualHost>にしてましたが、エラーが出てから<Location/>に対応するやつがなかったので一応</Location>に書き換えましたが、それでもエラーです。
3
+ ssl.confの中身は[このサイト](http://cos.linux-dvr.biz/archives/tag/ssl)で説明しているのと最終行以外全く同じです。最終行は最初間違えて</VirtualHost>にしてましたが、エラーが出てから<Location/>に対応するやつがなかったので一応</Location>に書き換えましたが、それでもsyntas errorです。
4
4
 
5
5
  関係ないかもしれませんが、
6
6