teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

3

追記

2019/04/02 13:37

投稿

yuudai
yuudai

スコア65

title CHANGED
File without changes
body CHANGED
@@ -7,4 +7,196 @@
7
7
  ```
8
8
  でEnter pass phrase for server.keyのところで適当に新しいパスワードを入力したら良いのかなと思い入力したらエラー?みたいなのがが出てしまったんですけどそのまま国や県を入力するところに進めたのでそのままにしています。
9
9
  apacheのversionは2.4.6です。
10
- どなたか助けてください。よろしくお願いします。
10
+ どなたか助けてください。よろしくお願いします。
11
+ ```
12
+ # When we also provide SSL we have to listen to the
13
+ # the HTTPS port in addition.
14
+ #
15
+ Listen 443
16
+
17
+ ##
18
+ ## SSL Global Context
19
+ ##
20
+ ## All SSL configuration in this context applies both to
21
+ ## the main server and all SSL-enabled virtual hosts.
22
+ ##
23
+
24
+ # Pass Phrase Dialog:
25
+ # Configure the pass phrase gathering process.
26
+ # The filtering dialog program (`builtin' is a internal
27
+ # terminal dialog) has to provide the pass phrase on stdout.
28
+ SSLPassPhraseDialog exec:/usr/libexec/httpd-ssl-pass-dialog
29
+
30
+ # Inter-Process Session Cache:
31
+ # Configure the SSL Session Cache: First the mechanism
32
+ # to use and second the expiring timeout (in seconds).
33
+ SSLSessionCache shmcb:/run/httpd/sslcache(512000)
34
+ SSLSessionCacheTimeout 300
35
+
36
+ # Pseudo Random Number Generator (PRNG):
37
+ # Configure one or more sources to seed the PRNG of the
38
+ # SSL library. The seed data should be of good random quality.
39
+ # WARNING! On some platforms /dev/random blocks if not enough entropy
40
+ # is available. This means you then cannot use the /dev/random device
41
+ # because it would lead to very long connection times (as long as
42
+ # it requires to make more entropy available). But usually those
43
+ # platforms additionally provide a /dev/urandom device which doesn't
44
+ # block. So, if available, use this one instead. Read the mod_ssl User
45
+ # Manual for more details.
46
+ SSLRandomSeed startup file:/dev/urandom 256
47
+ SSLRandomSeed connect builtin
48
+ #SSLRandomSeed startup file:/dev/random 512
49
+ #SSLRandomSeed connect file:/dev/random 512
50
+ #SSLRandomSeed connect file:/dev/urandom 512
51
+ Use "SSLCryptoDevice" to enable any supported hardware
52
+ # accelerators. Use "openssl engine -v" to list supported
53
+ # engine names. NOTE: If you enable an accelerator and the
54
+ # server does not start, consult the error logs and ensure
55
+ # your accelerator is functioning properly.
56
+ #
57
+ SSLCryptoDevice builtin
58
+ #SSLCryptoDevice ubsec
59
+
60
+ ##
61
+ ## SSL Virtual Host Context
62
+ ##
63
+
64
+ <VirtualHost _default_:443>
65
+
66
+ # General setup for the virtual host, inherited from global configuration
67
+ #DocumentRoot "/var/www/html"
68
+ ServerName www.sample.com:443
69
+
70
+ # Use separate log files for the SSL virtual host; note that LogLevel
71
+ # is not inherited from httpd.conf.
72
+ ErrorLog logs/ssl_error_log
73
+ TransferLog logs/ssl_access_log
74
+ LogLevel warn
75
+
76
+ # SSL Engine Switch:
77
+ # Enable/Disable SSL for this virtual host.
78
+ SSLEngine on
79
+
80
+ # SSL Protocol support:
81
+ # List the enable protocol levels with which clients will be able to
82
+ # connect. Disable SSLv2 access by default:
83
+ SSLProtocol all -SSLv2 -SSLv3
84
+ # SSL Cipher Suite:
85
+ # List the ciphers that the client is permitted to negotiate.
86
+ # See the mod_ssl documentation for a complete list.
87
+ SSLCipherSuite HIGH:3DES:!aNULL:!MD5:!SEED:!IDEA
88
+
89
+ # Speed-optimized SSL Cipher configuration:
90
+ # If speed is your main concern (on busy HTTPS servers e.g.),
91
+ # you might want to force clients to specific, performance
92
+ # optimized ciphers. In this case, prepend those ciphers
93
+ # to the SSLCipherSuite list, and enable SSLHonorCipherOrder.
94
+ # Caveat: by giving precedence to RC4-SHA and AES128-SHA
95
+ # (as in the example below), most connections will no longer
96
+ # have perfect forward secrecy - if the server's key is
97
+ # compromised, captures of past or future traffic must be
98
+ # considered compromised, too.
99
+ #SSLCipherSuite RC4-SHA:AES128-SHA:HIGH:MEDIUM:!aNULL:!MD5
100
+ #SSLHonorCipherOrder on
101
+
102
+ # Server Certificate:
103
+ # Point SSLCertificateFile at a PEM encoded certificate. If
104
+ # the certificate is encrypted, then you will be prompted for a
105
+ # pass phrase. Note that a kill -HUP will prompt again. A new
106
+ # certificate can be generated using the genkey(1) command.
107
+ SSLCertificateFile /etc/pki/tls/certs/server.crt
108
+
109
+ # Server Private Key:
110
+ # If the key is not combined with the certificate, use this
111
+ # directive to point at the key file. Keep in mind that if
112
+ # you've both a RSA and a DSA private key you can configure
113
+ # both in parallel (to also allow the use of DSA ciphers, etc.)
114
+ SSLCertificateKeyFile /etc/pki/tls/private/server.key
115
+
116
+ # Server Certificate Chain:
117
+ # Point SSLCertificateChainFile at a file containing the
118
+ # concatenation of PEM encoded CA certificates which form the
119
+ # certificate chain for the server certificate. Alternatively
120
+ # the referenced file can be the same as SSLCertificateFile
121
+ # when the CA certificates are directly appended to the server
122
+ # certificate for convinience.
123
+ #SSLCertificateChainFile /etc/pki/tls/certs/server-chain.crt
124
+
125
+ # Certificate Authority (CA):
126
+ # Set the CA certificate verification path where to find CA
127
+ # certificates for client authentication or alternatively one
128
+ # huge file containing all of them (file must be PEM encoded)
129
+ SSLCACertificateFile /etc/pki/tls/certs/ca-bundle.crt
130
+
131
+ # Client Authentication (Type):
132
+ # Client certificate verification type and depth. Types are
133
+ # none, optional, require and optional_no_ca. Depth is a
134
+ # number which specifies how deeply to verify the certificate
135
+ # issuer chain before deciding the certificate is not valid.
136
+ #SSLVerifyClient require
137
+ #SSLVerifyDepth 10
138
+
139
+ # Access Control:
140
+ # With SSLRequire you can do per-directory access control based
141
+ # on arbitrary complex boolean expressions containing server
142
+ # variable checks and other lookup directives. The syntax is a
143
+ # mixture between C and Perl. See the mod_ssl documentation
144
+ # for more details.
145
+ #<Location />
146
+ #SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \
147
+ # and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
148
+ # and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
149
+ # and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
150
+ # and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20 ) \
151
+ # or %{REMOTE_ADDR} =~ m/^192.76.162.[0-9]+$/
152
+ </VirtualHost>
153
+
154
+ # SSL Engine Options:
155
+ # Set various options for the SSL engine.
156
+ # o FakeBasicAuth:
157
+ # Translate the client X.509 into a Basic Authorisation. This means that
158
+ # the standard Auth/DBMAuth methods can be used for access control. The
159
+ # user name is the `one line' version of the client's X.509 certificate.
160
+ # Note that no password is obtained from the user. Every entry in the user
161
+ # file needs this password: `xxj31ZMTZzkVA'.
162
+ # o ExportCertData:
163
+ # This exports two additional environment variables: SSL_CLIENT_CERT and
164
+ # SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
165
+ # server (always existing) and the client (only existing when client
166
+ # authentication is used). This can be used to import the certificates
167
+ # into CGI scripts.
168
+ # o StdEnvVars:
169
+ # This exports the standard SSL/TLS related `SSL_*' environment variables.
170
+ # Per default this exportation is switched off for performance reasons,
171
+ # because the extraction step is an expensive operation and is usually
172
+ # useless for serving static content. So one usually enables the
173
+ # exportation for CGI and SSI requests only.
174
+ # o StrictRequire:
175
+ # This denies access when "SSLRequireSSL" or "SSLRequire" applied even
176
+ # under a "Satisfy any" situation, i.e. when it applies access is denied
177
+ # and no other module can change it.
178
+ # o OptRenegotiate:
179
+ # This enables optimized SSL connection renegotiation handling when SSL
180
+ # directives are used in per-directory context.
181
+ #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
182
+ <Files ~ ".(cgi|shtml|phtml|php3?)$">
183
+ SSLOptions +StdEnvVars
184
+ </Files>
185
+ <Directory "/var/www/cgi-bin">
186
+ SSLOptions +StdEnvVars
187
+ </Directory>
188
+
189
+
190
+ BrowserMatch "MSIE [2-5]" \
191
+ nokeepalive ssl-unclean-shutdown \
192
+ downgrade-1.0 force-response-1.0
193
+
194
+ # Per-Server Logging:
195
+ # The home of a custom SSL log file. Use this when you want a
196
+ # compact non-error SSL logfile on a virtual host basis.
197
+ CustomLog logs/ssl_request_log \
198
+ "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
199
+
200
+ </Location>
201
+ ```
202
+ 文字数制限があったので、コメントアウトされている文章のようなモノは省きました。

2

修正

2019/04/02 13:37

投稿

yuudai
yuudai

スコア65

title CHANGED
File without changes
body CHANGED
@@ -5,6 +5,6 @@
5
5
  # cd /etc/pki/tls/certs/
6
6
  # make server.crt
7
7
  ```
8
- でEnter pass phrase for server.keyのところで適当に新しいパスワードを入力したら良いのかなと思い入力したらエラーが出てしまって別に問題なうなのでそのままにしています。
8
+ でEnter pass phrase for server.keyのところで適当に新しいパスワードを入力したら良いのかなと思い入力したらエラー?みたいなの出てしまったんですけどそのまま国や県を入力するところに進めたのでそのままにしています。
9
9
  apacheのversionは2.4.6です。
10
10
  どなたか助けてください。よろしくお願いします。

1

修正

2019/04/02 10:28

投稿

yuudai
yuudai

スコア65

title CHANGED
File without changes
body CHANGED
@@ -1,5 +1,5 @@
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の最終行でもエラーが出ます。調べてもわからなかったので質問しました。
2
- ssl.confの中身は[このサイト](http://cos.linux-dvr.biz/archives/tag/ssl)で説明しているのと最終行以外全く同じです。最終行は最初間違えて</VirtualHost>にしてましたが、エラーが出てから<Location/>に対応するやつがなかったので一応</Location>に書き換えましたが、それでもエラーです。
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
+ ssl.confの中身は[このサイト](http://cos.linux-dvr.biz/archives/tag/ssl)で説明しているのと最終行以外全く同じです。最終行は最初間違えて</VirtualHost>にしてましたが、エラーが出てから<Location/>に対応するやつがなかったので一応</Location>に書き換えましたが、それでもsyntas errorです。
3
3
  関係ないかもしれませんが、
4
4
  ```ここに言語を入力
5
5
  # cd /etc/pki/tls/certs/