質問編集履歴

1

httpd\.conf追記

2017/01/22 06:39

投稿

ponsea
ponsea

スコア15

test CHANGED
File without changes
test CHANGED
@@ -97,3 +97,507 @@
97
97
 
98
98
 
99
99
  怪しいところ、些細なことでもいいのでアドバイス頂きたいです。
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+ 追記
108
+
109
+
110
+
111
+
112
+
113
+ apache conf
114
+
115
+ ```
116
+
117
+ # SHTMLに対応していないブラウザ
118
+
119
+ SetEnvIfExpr "!(%{HTTP_ACCEPT} -strcmatch '*application/xhtml+xml*') || %{HTTP_USER_AGENT} =~ m#UP\\.Browser/6\\.2|Nintendo 3DS| NX/1\\.#" LEGACY_BROWSER
120
+
121
+
122
+
123
+ ServerRoot "/etc/httpd"
124
+
125
+
126
+
127
+
128
+
129
+ #
130
+
131
+ #Listen 12.34.56.78:80
132
+
133
+ Listen 80
134
+
135
+
136
+
137
+
138
+
139
+ #
140
+
141
+ # Example:
142
+
143
+ # LoadModule foo_module modules/mod_foo.so
144
+
145
+ #
146
+
147
+ Include conf.modules.d/*.conf
148
+
149
+
150
+
151
+ #
152
+
153
+ # If you wish httpd to run as a different user or group, you must run
154
+
155
+ # httpd as root initially and it will switch.
156
+
157
+ #
158
+
159
+ # User/Group: The name (or #number) of the user/group to run httpd as.
160
+
161
+ # It is usually good practice to create a dedicated user and group for
162
+
163
+ # running httpd, as with most system services.
164
+
165
+ #
166
+
167
+ User apache
168
+
169
+ Group apache
170
+
171
+
172
+
173
+
174
+
175
+ #
176
+
177
+ # ServerAdmin: Your address, where problems with the server should be
178
+
179
+ # e-mailed. This address appears on some server-generated pages, such
180
+
181
+ # as error documents. e.g. admin@your-domain.com
182
+
183
+ #
184
+
185
+ ServerAdmin <私のメールアドレス>
186
+
187
+
188
+
189
+ #
190
+
191
+ # ServerName gives the name and port that the server uses to identify itself.
192
+
193
+ # This can often be determined automatically, but we recommend you specify
194
+
195
+ # it explicitly to prevent problems during startup.
196
+
197
+ #
198
+
199
+ # If your host doesn't have a registered DNS name, enter its IP address here.
200
+
201
+ #
202
+
203
+ ServerName <このサーバのホスト名>:80
204
+
205
+
206
+
207
+ #
208
+
209
+ # Deny access to the entirety of your server's filesystem. You must
210
+
211
+ # explicitly permit access to web content directories in other
212
+
213
+ # <Directory> blocks below.
214
+
215
+ #
216
+
217
+ <Directory />
218
+
219
+ AllowOverride none
220
+
221
+ Require all denied
222
+
223
+ </Directory>
224
+
225
+
226
+
227
+
228
+
229
+ #
230
+
231
+ # DocumentRoot: The directory out of which you will serve your
232
+
233
+ # documents. By default, all requests are taken from this directory, but
234
+
235
+ # symbolic links and aliases may be used to point to other locations.
236
+
237
+ #
238
+
239
+ DocumentRoot "/var/www/html"
240
+
241
+
242
+
243
+ #
244
+
245
+ # Relax access to content within /var/www.
246
+
247
+ #
248
+
249
+ # <Directory "/var/www">
250
+
251
+ # AllowOverride None
252
+
253
+ # # Allow open access:
254
+
255
+ # Require all granted
256
+
257
+ # </Directory>
258
+
259
+
260
+
261
+ # Further relax access to the default document root:
262
+
263
+ <Directory "/var/www">
264
+
265
+
266
+
267
+ # The Options directive is both complicated and important. Please see
268
+
269
+ # http://httpd.apache.org/docs/2.4/mod/core.html#options
270
+
271
+ # for more information.
272
+
273
+ #
274
+
275
+ Options FollowSymLinks
276
+
277
+
278
+
279
+ #
280
+
281
+ # AllowOverride controls what directives may be placed in .htaccess files.
282
+
283
+ # It can be "All", "None", or any combination of the keywords:
284
+
285
+ # Options FileInfo AuthConfig Limit
286
+
287
+ #
288
+
289
+ AllowOverride None
290
+
291
+
292
+
293
+ #
294
+
295
+ # Controls who can get stuff from this server.
296
+
297
+ #
298
+
299
+ # Require all granted
300
+
301
+ </Directory>
302
+
303
+
304
+
305
+ #
306
+
307
+ # DirectoryIndex: sets the file that Apache will serve if a directory
308
+
309
+ # is requested.
310
+
311
+ #
312
+
313
+ <IfModule dir_module>
314
+
315
+ DirectoryIndex index.html
316
+
317
+ </IfModule>
318
+
319
+ # スラッシュで終わるURLを、「index」を追加したURLにリダイレクトする
320
+
321
+ # RedirectMatch permanent ^(.*)/$ $1/index
322
+
323
+
324
+
325
+ #
326
+
327
+ # The following lines prevent .htaccess and .htpasswd files from being
328
+
329
+ # viewed by Web clients.
330
+
331
+ #
332
+
333
+ <Files ".ht*">
334
+
335
+ Require all denied
336
+
337
+ </Files>
338
+
339
+
340
+
341
+ #
342
+
343
+ # ErrorLog: The location of the error log file.
344
+
345
+ # If you do not specify an ErrorLog directive within a <VirtualHost>
346
+
347
+ # container, error messages relating to that virtual host will be
348
+
349
+ # logged here. If you *do* define an error logfile for a <VirtualHost>
350
+
351
+ # container, that host's errors will be logged there and not here.
352
+
353
+ #
354
+
355
+ ErrorLog "logs/error_log"
356
+
357
+
358
+
359
+ #
360
+
361
+ # LogLevel: Control the number of messages logged to the error_log.
362
+
363
+ # Possible values include: debug, info, notice, warn, error, crit,
364
+
365
+ # alert, emerg.
366
+
367
+ #
368
+
369
+ LogLevel warn
370
+
371
+
372
+
373
+ <IfModule log_config_module>
374
+
375
+ #
376
+
377
+ # The following directives define some format nicknames for use with
378
+
379
+ # a CustomLog directive (see below).
380
+
381
+ #
382
+
383
+ LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
384
+
385
+ LogFormat "%h %l %u %t \"%r\" %>s %b" common
386
+
387
+
388
+
389
+ <IfModule logio_module>
390
+
391
+ # You need to enable mod_logio.c to use %I and %O
392
+
393
+ LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
394
+
395
+ </IfModule>
396
+
397
+
398
+
399
+
400
+
401
+
402
+
403
+ #
404
+
405
+ # If you prefer a logfile with access, agent, and referer information
406
+
407
+ # (Combined Logfile Format) you can use the following directive.
408
+
409
+ #
410
+
411
+ CustomLog "logs/access_log" combined
412
+
413
+ </IfModule>
414
+
415
+
416
+
417
+ <IfModule alias_module>
418
+
419
+ #
420
+
421
+ # Redirect: Allows you to tell clients about documents that used to
422
+
423
+ # exist in your server's namespace, but do not anymore. The client
424
+
425
+ # will make a new request for the document at its new location.
426
+
427
+ # Example:
428
+
429
+ # Redirect permanent /foo http://www.example.com/bar
430
+
431
+ <If "-n %{PATH_INFO}">
432
+
433
+ # 存在しないディレクトリがURLに含まれていれば、404 Not Found を返す
434
+
435
+ Redirect 404 /
436
+
437
+ </If>
438
+
439
+
440
+
441
+
442
+
443
+ #
444
+
445
+ # ScriptAlias: This controls which directories contain server scripts.
446
+
447
+ # ScriptAliases are essentially the same as Aliases, except that
448
+
449
+ # documents in the target directory are treated as applications and
450
+
451
+ # run by the server when requested rather than as documents sent to the
452
+
453
+ # client. The same rules about trailing "/" apply to ScriptAlias
454
+
455
+ # directives as to Alias.
456
+
457
+ #
458
+
459
+ ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
460
+
461
+
462
+
463
+ </IfModule>
464
+
465
+
466
+
467
+ #
468
+
469
+ # "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
470
+
471
+ # CGI directory exists, if you have that configured.
472
+
473
+ #
474
+
475
+ <Directory "/var/www/cgi-bin">
476
+
477
+ AllowOverride None
478
+
479
+ Options None
480
+
481
+ Require all granted
482
+
483
+ </Directory>
484
+
485
+
486
+
487
+
488
+
489
+ <IfModule mime_module>
490
+
491
+
492
+
493
+ #
494
+
495
+ # If the AddEncoding directives above are commented-out, then you
496
+
497
+ # probably should define those extensions to indicate media types:
498
+
499
+ #
500
+
501
+ AddType application/x-compress .Z
502
+
503
+ AddType application/x-gzip .gz .tgz
504
+
505
+
506
+
507
+
508
+
509
+ #
510
+
511
+ # Filters allow you to process content before it is sent to the client.
512
+
513
+ #
514
+
515
+ # To parse .shtml files for server-side includes (SSI):
516
+
517
+ # (You will also need to add "Includes" to the "Options" directive.)
518
+
519
+ #
520
+
521
+ # AddType text/html .shtml
522
+
523
+ # AddOutputFilter INCLUDES .shtml
524
+
525
+
526
+
527
+ <If "-n reqenv('LEGACY_BROWSER')">
528
+
529
+ # XHTMLに対応していなければ
530
+
531
+ AddType text/html .xhtml
532
+
533
+ </If>
534
+
535
+ </IfModule>
536
+
537
+
538
+
539
+ #
540
+
541
+ # Specify a default charset for all content served; this enables
542
+
543
+ # interpretation of all content as UTF-8 by default. To use the
544
+
545
+ # default browser choice (ISO-8859-1), or to allow the META tags
546
+
547
+ # in HTML content to override this choice, comment out this
548
+
549
+ # directive:
550
+
551
+ #
552
+
553
+ # AddDefaultCharset UTF-8
554
+
555
+
556
+
557
+ # content-typeヘッダにcharsetパラメータを付加する
558
+
559
+ AddCharset utf-8 .xhtml .html .css .es .js .txt .json .xml .csv
560
+
561
+
562
+
563
+ <IfModule mime_magic_module>
564
+
565
+ #
566
+
567
+ # The mod_mime_magic module allows the server to use various hints from the
568
+
569
+ # contents of the file itself to determine its type. The MIMEMagicFile
570
+
571
+ # directive tells the module where the hint definitions are located.
572
+
573
+ #
574
+
575
+ MIMEMagicFile conf/magic
576
+
577
+ </IfModule>
578
+
579
+
580
+
581
+ EnableSendfile on
582
+
583
+
584
+
585
+ # Supplemental configuration
586
+
587
+ #
588
+
589
+ # Load config files in the "/etc/httpd/conf.d" directory, if any.
590
+
591
+ IncludeOptional conf.d/*.conf
592
+
593
+
594
+
595
+ ServerTokens ProductOnly
596
+
597
+ Header always set x-content-type-options nosniff
598
+
599
+ Header always set x-ua-compatible IE=edge
600
+
601
+
602
+
603
+ ```