質問編集履歴

1

conf/httpd.conf中身記述

2021/04/09 09:08

投稿

SETO22
SETO22

スコア3

test CHANGED
File without changes
test CHANGED
@@ -81,3 +81,431 @@
81
81
  nginx 1.12.2
82
82
 
83
83
  unicorn 5.8.0
84
+
85
+
86
+
87
+ ###追記
88
+
89
+ conf/httpd.confの中身です。※字数制限のため、コメントアウト部を一部添削しています。
90
+
91
+ ```
92
+
93
+ ServerRoot "/etc/httpd"
94
+
95
+
96
+
97
+ Listen 80
98
+
99
+
100
+
101
+ Include conf.modules.d/*.conf
102
+
103
+
104
+
105
+ User apache
106
+
107
+ Group apache
108
+
109
+
110
+
111
+ ServerAdmin root@localhost
112
+
113
+
114
+
115
+ <Directory />
116
+
117
+ AllowOverride none
118
+
119
+ Require all denied
120
+
121
+ </Directory>
122
+
123
+ #
124
+
125
+ # Note that from this point forward you must specifically allow
126
+
127
+ # particular features to be enabled - so if something's not working as
128
+
129
+ # you might expect, make sure that you have specifically enabled it
130
+
131
+ # below.
132
+
133
+ #
134
+
135
+ #
136
+
137
+ # DocumentRoot: The directory out of which you will serve your
138
+
139
+ # documents. By default, all requests are taken from this directory, but
140
+
141
+ # symbolic links and aliases may be used to point to other locations.
142
+
143
+ #
144
+
145
+ DocumentRoot "/var/www/html"
146
+
147
+ #
148
+
149
+ # Relax access to content within /var/www.
150
+
151
+ #
152
+
153
+ <Directory "/var/www">
154
+
155
+ AllowOverride None
156
+
157
+ # Allow open access:
158
+
159
+ Require all granted
160
+
161
+ </Directory>
162
+
163
+ # Further relax access to the default document root:
164
+
165
+ <Directory "/var/www/html">
166
+
167
+ Options Indexes FollowSymLinks
168
+
169
+ AllowOverride None
170
+
171
+ </Directory>
172
+
173
+ #
174
+
175
+ #
176
+
177
+ # DirectoryIndex: sets the file that Apache will serve if a directory
178
+
179
+ # is requested.
180
+
181
+ #
182
+
183
+ <IfModule dir_module>
184
+
185
+ DirectoryIndex index.html
186
+
187
+ </IfModule>
188
+
189
+ #
190
+
191
+ # The following lines prevent .htaccess and .htpasswd files from being
192
+
193
+ # viewed by Web clients.
194
+
195
+ #
196
+
197
+ <Files ".ht*">
198
+
199
+ Require all denied
200
+
201
+ </Files>
202
+
203
+ #
204
+
205
+ # ErrorLog: The location of the error log file.
206
+
207
+ # If you do not specify an ErrorLog directive within a <VirtualHost>
208
+
209
+ # container, error messages relating to that virtual host will be
210
+
211
+ # logged here. If you *do* define an error logfile for a <VirtualHost>
212
+
213
+ # container, that host's errors will be logged there and not here.
214
+
215
+ #
216
+
217
+ ErrorLog "logs/error_log"
218
+
219
+ #
220
+
221
+ # LogLevel: Control the number of messages logged to the error_log.
222
+
223
+ # Possible values include: debug, info, notice, warn, error, crit,
224
+
225
+ # alert, emerg.
226
+
227
+ #
228
+
229
+ LogLevel warn
230
+
231
+ <IfModule log_config_module>
232
+
233
+ #
234
+
235
+ # The following directives define some format nicknames for use with
236
+
237
+ # a CustomLog directive (see below).
238
+
239
+ #
240
+
241
+ LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
242
+
243
+ LogFormat "%h %l %u %t \"%r\" %>s %b" common
244
+
245
+ <IfModule logio_module>
246
+
247
+ # You need to enable mod_logio.c to use %I and %O
248
+
249
+ LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
250
+
251
+ </IfModule>
252
+
253
+ CustomLog "logs/access_log" combined
254
+
255
+ </IfModule>
256
+
257
+ <IfModule alias_module>
258
+
259
+ #
260
+
261
+ # Redirect: Allows you to tell clients about documents that used to
262
+
263
+ # exist in your server's namespace, but do not anymore. The client
264
+
265
+ # will make a new request for the document at its new location.
266
+
267
+ # Example:
268
+
269
+ # Redirect permanent /foo http://www.example.com/bar
270
+
271
+ #
272
+
273
+ # Alias: Maps web paths into filesystem paths and is used to
274
+
275
+ # access content that does not live under the DocumentRoot.
276
+
277
+ # Example:
278
+
279
+ # Alias /webpath /full/filesystem/path
280
+
281
+ #
282
+
283
+ # If you include a trailing / on /webpath then the server will
284
+
285
+ # require it to be present in the URL. You will also likely
286
+
287
+ # need to provide a <Directory> section to allow access to
288
+
289
+ # the filesystem path.
290
+
291
+ #
292
+
293
+ # ScriptAlias: This controls which directories contain server scripts.
294
+
295
+ # ScriptAliases are essentially the same as Aliases, except that
296
+
297
+ # documents in the target directory are treated as applications and
298
+
299
+ # run by the server when requested rather than as documents sent to the
300
+
301
+ # client. The same rules about trailing "/" apply to ScriptAlias
302
+
303
+ # directives as to Alias.
304
+
305
+ #
306
+
307
+ ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
308
+
309
+
310
+
311
+ </IfModule>
312
+
313
+ #
314
+
315
+ # "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
316
+
317
+ # CGI directory exists, if you have that configured.
318
+
319
+ #
320
+
321
+ <Directory "/var/www/cgi-bin">
322
+
323
+ AllowOverride None
324
+
325
+ Options None
326
+
327
+ Require all granted
328
+
329
+ </Directory>
330
+
331
+ <IfModule mime_module>
332
+
333
+ #
334
+
335
+ # TypesConfig points to the file containing the list of mappings from
336
+
337
+ # filename extension to MIME-type.
338
+
339
+ #
340
+
341
+ TypesConfig /etc/mime.types
342
+
343
+ #
344
+
345
+ # AddType allows you to add to or override the MIME configuration
346
+
347
+ # file specified in TypesConfig for specific file types.
348
+
349
+ #
350
+
351
+ #AddType application/x-gzip .tgz
352
+
353
+ #
354
+
355
+ # AddEncoding allows you to have certain browsers uncompress
356
+
357
+ # information on the fly. Note: Not all browsers support this.
358
+
359
+ #
360
+
361
+ #AddEncoding x-compress .Z
362
+
363
+ #AddEncoding x-gzip .gz .tgz
364
+
365
+ #
366
+
367
+ # If the AddEncoding directives above are commented-out, then you
368
+
369
+ # probably should define those extensions to indicate media types:
370
+
371
+ #
372
+
373
+ AddType application/x-compress .Z
374
+
375
+ AddType application/x-gzip .gz .tgz
376
+
377
+ #
378
+
379
+ # AddHandler allows you to map certain file extensions to "handlers":
380
+
381
+ # actions unrelated to filetype. These can be either built into the server
382
+
383
+ # or added with the Action directive (see below)
384
+
385
+ #
386
+
387
+ # To use CGI scripts outside of ScriptAliased directories:
388
+
389
+ # (You will also need to add "ExecCGI" to the "Options" directive.)
390
+
391
+ #
392
+
393
+ #AddHandler cgi-script .cgi
394
+
395
+ # For type maps (negotiated resources):
396
+
397
+ #AddHandler type-map var
398
+
399
+ #
400
+
401
+ # Filters allow you to process content before it is sent to the client.
402
+
403
+ #
404
+
405
+ # To parse .shtml files for server-side includes (SSI):
406
+
407
+ # (You will also need to add "Includes" to the "Options" directive.)
408
+
409
+ #
410
+
411
+ AddType text/html .shtml
412
+
413
+ AddOutputFilter INCLUDES .shtml
414
+
415
+ </IfModule>
416
+
417
+ #
418
+
419
+ # Specify a default charset for all content served; this enables
420
+
421
+ # interpretation of all content as UTF-8 by default. To use the
422
+
423
+ # default browser choice (ISO-8859-1), or to allow the META tags
424
+
425
+ # in HTML content to override this choice, comment out this
426
+
427
+ # directive:
428
+
429
+ #
430
+
431
+ AddDefaultCharset UTF-8
432
+
433
+ <IfModule mime_magic_module>
434
+
435
+ #
436
+
437
+ # The mod_mime_magic module allows the server to use various hints from the
438
+
439
+ # contents of the file itself to determine its type. The MIMEMagicFile
440
+
441
+ # directive tells the module where the hint definitions are located.
442
+
443
+ #
444
+
445
+ MIMEMagicFile conf/magic
446
+
447
+ </IfModule>
448
+
449
+ #
450
+
451
+ # Customizable error responses come in three flavors:
452
+
453
+ # 1) plain text 2) local redirects 3) external redirects
454
+
455
+ #
456
+
457
+ # Some examples:
458
+
459
+ #ErrorDocument 500 "The server made a boo boo."
460
+
461
+ #ErrorDocument 404 /missing.html
462
+
463
+ #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
464
+
465
+ #ErrorDocument 402 http://www.example.com/subscription_info.html
466
+
467
+ #
468
+
469
+ #
470
+
471
+ # EnableMMAP and EnableSendfile: On systems that support it,
472
+
473
+ # memory-mapping or the sendfile syscall may be used to deliver
474
+
475
+ # files. This usually improves server performance, but must
476
+
477
+ # be turned off when serving from networked-mounted
478
+
479
+ # filesystems or if support for these functions is otherwise
480
+
481
+ # broken on your system.
482
+
483
+ # Defaults if commented: EnableMMAP On, EnableSendfile Off
484
+
485
+ #
486
+
487
+ #EnableMMAP off
488
+
489
+ EnableSendfile on
490
+
491
+ # Enable HTTP/2 by default
492
+
493
+ #
494
+
495
+ # https://httpd.apache.org/docs/2.4/mod/core.html#protocols
496
+
497
+ <IfModule mod_http2.c>
498
+
499
+ Protocols h2 h2c http/1.1
500
+
501
+ </IfModule>
502
+
503
+ # Supplemental configuration
504
+
505
+ #
506
+
507
+ # Load config files in the "/etc/httpd/conf.d" directory, if any.
508
+
509
+ IncludeOptional conf.d/*.conf
510
+
511
+ ```