質問編集履歴
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -9,3 +9,451 @@
|
|
9
9
|
Apache:Apache2
|
10
10
|
|
11
11
|
です。
|
12
|
+
|
13
|
+
###追記 Apache2.conf
|
14
|
+
|
15
|
+
```ここに言語を入力
|
16
|
+
|
17
|
+
# This is the main Apache server configuration file. It contains the
|
18
|
+
|
19
|
+
# configuration directives that give the server its instructions.
|
20
|
+
|
21
|
+
# See http://httpd.apache.org/docs/2.4/ for detailed information about
|
22
|
+
|
23
|
+
# the directives and /usr/share/doc/apache2/README.Debian about Debian specific
|
24
|
+
|
25
|
+
# hints.
|
26
|
+
|
27
|
+
#
|
28
|
+
|
29
|
+
#
|
30
|
+
|
31
|
+
# Summary of how the Apache 2 configuration works in Debian:
|
32
|
+
|
33
|
+
# The Apache 2 web server configuration in Debian is quite different to
|
34
|
+
|
35
|
+
# upstream's suggested way to configure the web server. This is because Debian's
|
36
|
+
|
37
|
+
# default Apache2 installation attempts to make adding and removing modules,
|
38
|
+
|
39
|
+
# virtual hosts, and extra configuration directives as flexible as possible, in
|
40
|
+
|
41
|
+
# order to make automating the changes and administering the server as easy as
|
42
|
+
|
43
|
+
# possible.
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
# It is split into several files forming the configuration hierarchy outlined
|
48
|
+
|
49
|
+
# below, all located in the /etc/apache2/ directory:
|
50
|
+
|
51
|
+
#
|
52
|
+
|
53
|
+
# /etc/apache2/
|
54
|
+
|
55
|
+
# |-- apache2.conf
|
56
|
+
|
57
|
+
# | `-- ports.conf
|
58
|
+
|
59
|
+
# |-- mods-enabled
|
60
|
+
|
61
|
+
# | |-- *.load
|
62
|
+
|
63
|
+
# | `-- *.conf
|
64
|
+
|
65
|
+
# |-- conf-enabled
|
66
|
+
|
67
|
+
# | `-- *.conf
|
68
|
+
|
69
|
+
# `-- sites-enabled
|
70
|
+
|
71
|
+
# `-- *.conf
|
72
|
+
|
73
|
+
#
|
74
|
+
|
75
|
+
#
|
76
|
+
|
77
|
+
# * apache2.conf is the main configuration file (this file). It puts the pieces
|
78
|
+
|
79
|
+
# together by including all remaining configuration files when starting up the
|
80
|
+
|
81
|
+
# web server.
|
82
|
+
|
83
|
+
#
|
84
|
+
|
85
|
+
# * ports.conf is always included from the main configuration file. It is
|
86
|
+
|
87
|
+
# supposed to determine listening ports for incoming connections which can be
|
88
|
+
|
89
|
+
# customized anytime.
|
90
|
+
|
91
|
+
#
|
92
|
+
|
93
|
+
# * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/
|
94
|
+
|
95
|
+
# directories contain particular configuration snippets which manage modules,
|
96
|
+
|
97
|
+
# global configuration fragments, or virtual host configurations,
|
98
|
+
|
99
|
+
# respectively.
|
100
|
+
|
101
|
+
#
|
102
|
+
|
103
|
+
# They are activated by symlinking available configuration files from their
|
104
|
+
|
105
|
+
# respective *-available/ counterparts. These should be managed by using our
|
106
|
+
|
107
|
+
# helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See
|
108
|
+
|
109
|
+
# their respective man pages for detailed information.
|
110
|
+
|
111
|
+
#
|
112
|
+
|
113
|
+
# * The binary is called apache2. Due to the use of environment variables, in
|
114
|
+
|
115
|
+
# the default configuration, apache2 needs to be started/stopped with
|
116
|
+
|
117
|
+
# /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not
|
118
|
+
|
119
|
+
# work with the default configuration.
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
# Global configuration
|
126
|
+
|
127
|
+
#
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
#
|
132
|
+
|
133
|
+
# ServerRoot: The top of the directory tree under which the server's
|
134
|
+
|
135
|
+
# configuration, error, and log files are kept.
|
136
|
+
|
137
|
+
#
|
138
|
+
|
139
|
+
# NOTE! If you intend to place this on an NFS (or otherwise network)
|
140
|
+
|
141
|
+
# mounted filesystem then please read the Mutex documentation (available
|
142
|
+
|
143
|
+
# at <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
|
144
|
+
|
145
|
+
# you will save yourself a lot of trouble.
|
146
|
+
|
147
|
+
#
|
148
|
+
|
149
|
+
# Do NOT add a slash at the end of the directory path.
|
150
|
+
|
151
|
+
#
|
152
|
+
|
153
|
+
#ServerRoot "/etc/apache2"
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
#
|
158
|
+
|
159
|
+
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
|
160
|
+
|
161
|
+
#
|
162
|
+
|
163
|
+
Mutex file:${APACHE_LOCK_DIR} default
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
#
|
168
|
+
|
169
|
+
# PidFile: The file in which the server should record its process
|
170
|
+
|
171
|
+
# identification number when it starts.
|
172
|
+
|
173
|
+
# This needs to be set in /etc/apache2/envvars
|
174
|
+
|
175
|
+
#
|
176
|
+
|
177
|
+
PidFile ${APACHE_PID_FILE}
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
#
|
182
|
+
|
183
|
+
# Timeout: The number of seconds before receives and sends time out.
|
184
|
+
|
185
|
+
#
|
186
|
+
|
187
|
+
Timeout 300
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
#
|
192
|
+
|
193
|
+
# KeepAlive: Whether or not to allow persistent connections (more than
|
194
|
+
|
195
|
+
# one request per connection). Set to "Off" to deactivate.
|
196
|
+
|
197
|
+
#
|
198
|
+
|
199
|
+
KeepAlive On
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
#
|
204
|
+
|
205
|
+
# MaxKeepAliveRequests: The maximum number of requests to allow
|
206
|
+
|
207
|
+
# during a persistent connection. Set to 0 to allow an unlimited amount.
|
208
|
+
|
209
|
+
# We recommend you leave this number high, for maximum performance.
|
210
|
+
|
211
|
+
#
|
212
|
+
|
213
|
+
MaxKeepAliveRequests 100
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
#
|
218
|
+
|
219
|
+
# KeepAliveTimeout: Number of seconds to wait for the next request from the
|
220
|
+
|
221
|
+
# same client on the same connection.
|
222
|
+
|
223
|
+
#
|
224
|
+
|
225
|
+
KeepAliveTimeout 5
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
# These need to be set in /etc/apache2/envvars
|
232
|
+
|
233
|
+
User ${APACHE_RUN_USER}
|
234
|
+
|
235
|
+
Group ${APACHE_RUN_GROUP}
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
#
|
240
|
+
|
241
|
+
# HostnameLookups: Log the names of clients or just their IP addresses
|
242
|
+
|
243
|
+
# e.g., www.apache.org (on) or 204.62.129.132 (off).
|
244
|
+
|
245
|
+
# The default is off because it'd be overall better for the net if people
|
246
|
+
|
247
|
+
# had to knowingly turn this feature on, since enabling it means that
|
248
|
+
|
249
|
+
# each client request will result in AT LEAST one lookup request to the
|
250
|
+
|
251
|
+
# nameserver.
|
252
|
+
|
253
|
+
#
|
254
|
+
|
255
|
+
HostnameLookups Off
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
# ErrorLog: The location of the error log file.
|
260
|
+
|
261
|
+
# If you do not specify an ErrorLog directive within a <VirtualHost>
|
262
|
+
|
263
|
+
# container, error messages relating to that virtual host will be
|
264
|
+
|
265
|
+
# logged here. If you *do* define an error logfile for a <VirtualHost>
|
266
|
+
|
267
|
+
# container, that host's errors will be logged there and not here.
|
268
|
+
|
269
|
+
#
|
270
|
+
|
271
|
+
ErrorLog ${APACHE_LOG_DIR}/error.log
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
#
|
276
|
+
|
277
|
+
# LogLevel: Control the severity of messages logged to the error_log.
|
278
|
+
|
279
|
+
# Available values: trace8, ..., trace1, debug, info, notice, warn,
|
280
|
+
|
281
|
+
# error, crit, alert, emerg.
|
282
|
+
|
283
|
+
# It is also possible to configure the log level for particular modules, e.g.
|
284
|
+
|
285
|
+
# "LogLevel info ssl:warn"
|
286
|
+
|
287
|
+
#
|
288
|
+
|
289
|
+
LogLevel warn
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
# Include module configuration:
|
294
|
+
|
295
|
+
IncludeOptional mods-enabled/*.load
|
296
|
+
|
297
|
+
IncludeOptional mods-enabled/*.conf
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
# Include list of ports to listen on
|
302
|
+
|
303
|
+
Include ports.conf
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
# Sets the default security model of the Apache2 HTTPD server. It does
|
310
|
+
|
311
|
+
# not allow access to the root filesystem outside of /usr/share and /var/www.
|
312
|
+
|
313
|
+
# The former is used by web applications packaged in Debian,
|
314
|
+
|
315
|
+
# the latter may be used for local directories served by the web server. If
|
316
|
+
|
317
|
+
# your system is serving content from a sub-directory in /srv you must allow
|
318
|
+
|
319
|
+
# access here, or in any related virtual host.
|
320
|
+
|
321
|
+
<Directory />
|
322
|
+
|
323
|
+
Options FollowSymLinks
|
324
|
+
|
325
|
+
AllowOverride None
|
326
|
+
|
327
|
+
Require all denied
|
328
|
+
|
329
|
+
</Directory>
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
<Directory /usr/share>
|
334
|
+
|
335
|
+
AllowOverride None
|
336
|
+
|
337
|
+
Require all granted
|
338
|
+
|
339
|
+
</Directory>
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
<Directory /var/www/>
|
344
|
+
|
345
|
+
Options Indexes FollowSymLinks
|
346
|
+
|
347
|
+
AllowOverride None
|
348
|
+
|
349
|
+
Require all granted
|
350
|
+
|
351
|
+
</Directory>
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
#<Directory /srv/>
|
356
|
+
|
357
|
+
# Options Indexes FollowSymLinks
|
358
|
+
|
359
|
+
# AllowOverride None
|
360
|
+
|
361
|
+
# Require all granted
|
362
|
+
|
363
|
+
#</Directory>
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
|
370
|
+
|
371
|
+
|
372
|
+
|
373
|
+
# AccessFileName: The name of the file to look for in each directory
|
374
|
+
|
375
|
+
# for additional configuration directives. See also the AllowOverride
|
376
|
+
|
377
|
+
# directive.
|
378
|
+
|
379
|
+
#
|
380
|
+
|
381
|
+
AccessFileName .htaccess
|
382
|
+
|
383
|
+
|
384
|
+
|
385
|
+
#
|
386
|
+
|
387
|
+
# The following lines prevent .htaccess and .htpasswd files from being
|
388
|
+
|
389
|
+
# viewed by Web clients.
|
390
|
+
|
391
|
+
#
|
392
|
+
|
393
|
+
<FilesMatch "^.ht">
|
394
|
+
|
395
|
+
Require all denied
|
396
|
+
|
397
|
+
</FilesMatch>
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
#
|
404
|
+
|
405
|
+
# The following directives define some format nicknames for use with
|
406
|
+
|
407
|
+
# a CustomLog directive.
|
408
|
+
|
409
|
+
#
|
410
|
+
|
411
|
+
# These deviate from the Common Log Format definitions in that they use %O
|
412
|
+
|
413
|
+
# (the actual bytes sent including headers) instead of %b (the size of the
|
414
|
+
|
415
|
+
# requested file), because the latter makes it impossible to detect partial
|
416
|
+
|
417
|
+
# requests.
|
418
|
+
|
419
|
+
#
|
420
|
+
|
421
|
+
# Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
|
422
|
+
|
423
|
+
# Use mod_remoteip instead.
|
424
|
+
|
425
|
+
#
|
426
|
+
|
427
|
+
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
|
428
|
+
|
429
|
+
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
|
430
|
+
|
431
|
+
LogFormat "%h %l %u %t \"%r\" %>s %O" common
|
432
|
+
|
433
|
+
LogFormat "%{Referer}i -> %U" referer
|
434
|
+
|
435
|
+
LogFormat "%{User-agent}i" agent
|
436
|
+
|
437
|
+
|
438
|
+
|
439
|
+
# Include of directories ignores editors' and dpkg's backup files,
|
440
|
+
|
441
|
+
# see README.Debian for details.
|
442
|
+
|
443
|
+
|
444
|
+
|
445
|
+
# Include generic snippets of statements
|
446
|
+
|
447
|
+
IncludeOptional conf-enabled/*.conf
|
448
|
+
|
449
|
+
|
450
|
+
|
451
|
+
# Include the virtual host configurations:
|
452
|
+
|
453
|
+
IncludeOptional sites-enabled/*.conf
|
454
|
+
|
455
|
+
|
456
|
+
|
457
|
+
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
|
458
|
+
|
459
|
+
```
|