2
# Based upon the NCSA server configuration files originally by Rob McCool.
4
# This is the main Apache server configuration file. It contains the
5
# configuration directives that give the server its instructions.
6
# See <URL:http://httpd.apache.org/docs-2.1/> for detailed information about
9
# Do NOT simply read the instructions in here without understanding
10
# what they do. They're here only as hints or reminders. If you are unsure
11
# consult the online docs. You have been warned.
13
# The configuration directives are grouped into three basic sections:
14
# 1. Directives that control the operation of the Apache server process as a
15
# whole (the 'global environment').
16
# 2. Directives that define the parameters of the 'main' or 'default' server,
17
# which responds to requests that aren't handled by a virtual host.
18
# These directives also provide default values for the settings
19
# of all virtual hosts.
20
# 3. Settings for virtual hosts, which allow Web requests to be sent to
21
# different IP addresses or hostnames and have them handled by the
22
# same Apache server process.
24
# Configuration and logfile names: If the filenames you specify for many
25
# of the server's control files begin with "/" (or "drive:/" for Win32), the
26
# server will use that explicit path. If the filenames do *not* begin
27
# with "/", the value of ServerRoot is prepended -- so "/var/log/apache2/foo.log"
28
# with ServerRoot set to "" will be interpreted by the
29
# server as "//var/log/apache2/foo.log".
32
### Section 1: Global Environment
34
# The directives in this section affect the overall operation of Apache,
35
# such as the number of concurrent requests it can handle or where it
36
# can find its configuration files.
40
# ServerRoot: The top of the directory tree under which the server's
41
# configuration, error, and log files are kept.
43
# NOTE! If you intend to place this on an NFS (or otherwise network)
44
# mounted filesystem then please read the LockFile documentation (available
45
# at <URL:http://httpd.apache.org/docs-2.1/mod/mpm_common.html#lockfile>);
46
# you will save yourself a lot of trouble.
48
# Do NOT add a slash at the end of the directory path.
50
ServerRoot "/etc/apache2"
53
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
55
#<IfModule !mpm_winnt.c>
56
#<IfModule !mpm_netware.c>
57
LockFile /var/lock/apache2/accept.lock
62
# PidFile: The file in which the server should record its process
63
# identification number when it starts.
65
PidFile /var/run/apache2.pid
68
# Timeout: The number of seconds before receives and sends time out.
73
# KeepAlive: Whether or not to allow persistent connections (more than
74
# one request per connection). Set to "Off" to deactivate.
79
# MaxKeepAliveRequests: The maximum number of requests to allow
80
# during a persistent connection. Set to 0 to allow an unlimited amount.
81
# We recommend you leave this number high, for maximum performance.
83
MaxKeepAliveRequests 100
86
# KeepAliveTimeout: Number of seconds to wait for the next request from the
87
# same client on the same connection.
92
## Server-Pool Size Regulation (MPM specific)
96
# StartServers: number of server processes to start
97
# MinSpareServers: minimum number of server processes which are kept spare
98
# MaxSpareServers: maximum number of server processes which are kept spare
99
# MaxClients: maximum number of server processes allowed to start
100
# MaxRequestsPerChild: maximum number of requests a server process serves
106
MaxRequestsPerChild 0
110
# StartServers: initial number of server processes to start
111
# MaxClients: maximum number of simultaneous client connections
112
# MinSpareThreads: minimum number of worker threads which are kept spare
113
# MaxSpareThreads: maximum number of worker threads which are kept spare
114
# ThreadsPerChild: constant number of worker threads in each server process
115
# MaxRequestsPerChild: maximum number of requests a server process serves
122
MaxRequestsPerChild 0
126
# NumServers: constant number of server processes
127
# StartThreads: initial number of worker threads in each server process
128
# MinSpareThreads: minimum number of worker threads which are kept spare
129
# MaxSpareThreads: maximum number of worker threads which are kept spare
130
# MaxThreadsPerChild: maximum number of worker threads in each server process
131
# MaxRequestsPerChild: maximum number of connections per server process
132
<IfModule perchild.c>
137
MaxThreadsPerChild 20
138
MaxRequestsPerChild 0
145
AccessFileName .htaccess
147
# The following lines prevent .htaccess and .htpasswd files from being
148
# viewed by Web clients.
155
TypesConfig /etc/mime.types
158
# DefaultType is the default MIME type the server will use for a document
159
# if it cannot otherwise determine one, such as from filename extensions.
160
# If your server contains mostly text or HTML documents, "text/plain" is
161
# a good value. If most of your content is binary, such as applications
162
# or images, you may want to use "application/octet-stream" instead to
163
# keep browsers from trying to display binary files as though they are
166
DefaultType text/plain
170
# HostnameLookups: Log the names of clients or just their IP addresses
171
# e.g., www.apache.org (on) or 204.62.129.132 (off).
172
# The default is off because it'd be overall better for the net if people
173
# had to knowingly turn this feature on, since enabling it means that
174
# each client request will result in AT LEAST one lookup request to the
179
# ErrorLog: The location of the error log file.
180
# If you do not specify an ErrorLog directive within a <VirtualHost>
181
# container, error messages relating to that virtual host will be
182
# logged here. If you *do* define an error logfile for a <VirtualHost>
183
# container, that host's errors will be logged there and not here.
185
ErrorLog /var/log/apache2/error_log
188
# LogLevel: Control the number of messages logged to the error_log.
189
# Possible values include: debug, info, notice, warn, error, crit,
194
# Include module configuration:
195
Include /etc/apache2/mods-enabled/*.load
196
Include /etc/apache2/mods-enabled/*.conf
198
# Include all the user configurations:
199
Include /etc/apache2/httpd.conf
201
# Include ports listing
202
Include /etc/apache2/ports.conf
204
# Include generic snippets of statements
205
Include /etc/apache2/conf.d/[^.#]*
208
# The following directives define some format nicknames for use with
209
# a CustomLog directive (see below).
211
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
212
LogFormat "%h %l %u %t \"%r\" %>s %b" common
213
LogFormat "%{Referer}i -> %U" referer
214
LogFormat "%{User-agent}i" agent
218
# This directive configures what you return as the Server HTTP response
219
# Header. The default is 'Full' which sends information about the OS-Type
220
# and compiled in modules.
221
# Set to one of: Full | OS | Minor | Minimal | Major | Prod
222
# where Full conveys the most information, and Prod the least.
227
# Optionally add a line containing the server version and virtual host
228
# name to server-generated pages (internal error documents, FTP directory
229
# listings, mod_status and mod_info output etc., but not CGI generated
230
# documents or custom error documents).
231
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
232
# Set to one of: On | Off | EMail
236
<IfModule mod_alias.c>
238
# Aliases: Add here as many aliases as you need (with no limit). The format is
239
# Alias fakename realname
241
# Note that if you include a trailing / on fakename then the server will
242
# require it to be present in the URL. So "/icons" isn't aliased in this
243
# example, only "/icons/". If the fakename is slash-terminated, then the
244
# realname must also be slash terminated, and if the fakename omits the
245
# trailing slash, the realname must also omit it.
247
# We include the /icons/ alias for FancyIndexed directory listings. If
248
# you do not use FancyIndexing, you may comment this out.
250
Alias /icons/ "/usr/share/apache2/icons/"
252
<Directory "/usr/share/apache2/icons">
253
Options Indexes MultiViews
262
# Directives controlling the display of server-generated directory listings.
264
<IfModule mod_autoindex.c>
267
# IndexOptions: Controls the appearance of server-generated directory
270
IndexOptions FancyIndexing VersionSort
273
# AddIcon* directives tell the server which icon to show for different
274
# files or filename extensions. These are only displayed for
275
# FancyIndexed directories.
277
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
279
AddIconByType (TXT,/icons/text.gif) text/*
280
AddIconByType (IMG,/icons/image2.gif) image/*
281
AddIconByType (SND,/icons/sound2.gif) audio/*
282
AddIconByType (VID,/icons/movie.gif) video/*
284
AddIcon /icons/binary.gif .bin .exe
285
AddIcon /icons/binhex.gif .hqx
286
AddIcon /icons/tar.gif .tar
287
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
288
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
289
AddIcon /icons/a.gif .ps .ai .eps
290
AddIcon /icons/layout.gif .html .shtml .htm .pdf
291
AddIcon /icons/text.gif .txt
292
AddIcon /icons/c.gif .c
293
AddIcon /icons/p.gif .pl .py
294
AddIcon /icons/f.gif .for
295
AddIcon /icons/dvi.gif .dvi
296
AddIcon /icons/uuencoded.gif .uu
297
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
298
AddIcon /icons/tex.gif .tex
299
AddIcon /icons/bomb.gif core
301
AddIcon /icons/back.gif ..
302
AddIcon /icons/hand.right.gif README
303
AddIcon /icons/folder.gif ^^DIRECTORY^^
304
AddIcon /icons/blank.gif ^^BLANKICON^^
307
# DefaultIcon is which icon to show for files which do not have an icon
310
DefaultIcon /icons/unknown.gif
313
# AddDescription allows you to place a short description after a file in
314
# server-generated indexes. These are only displayed for FancyIndexed
316
# Format: AddDescription "description" filename
318
#AddDescription "GZIP compressed document" .gz
319
#AddDescription "tar archive" .tar
320
#AddDescription "GZIP compressed tar archive" .tgz
323
# ReadmeName is the name of the README file the server will look for by
324
# default, and append to directory listings.
326
# HeaderName is the name of a file which should be prepended to
328
ReadmeName README.html
329
HeaderName HEADER.html
332
# IndexIgnore is a set of filenames which directory indexing should ignore
333
# and not include in the listing. Shell-style wildcarding is permitted.
335
IndexIgnore .??* *~ *# RCS CVS *,v *,t
338
<IfModule mod_mime.c>
341
# AddType allows you to add to or override the MIME configuration
342
# file mime.types for specific file types.
344
#AddType application/x-gzip .tgz
346
# AddEncoding allows you to have certain browsers uncompress
347
# information on the fly. Note: Not all browsers support this.
348
# Despite the name similarity, the following Add* directives have
349
# nothing to do with the FancyIndexing customization directives above.
351
#AddEncoding x-compress .Z
352
#AddEncoding x-gzip .gz .tgz
354
# If the AddEncoding directives above are commented-out, then you
355
# probably should define those extensions to indicate media types:
357
AddType application/x-compress .Z
358
AddType application/x-gzip .gz .tgz
361
# DefaultLanguage and AddLanguage allows you to specify the language of
362
# a document. You can then use content negotiation to give a browser a
363
# file in a language the user can understand.
365
# Specify a default language. This means that all data
366
# going out without a specific language tag (see below) will
367
# be marked with this one. You probably do NOT want to set
368
# this unless you are sure it is correct for all cases.
370
# * It is generally better to not mark a page as
371
# * being a certain language than marking it with the wrong
376
# Note 1: The suffix does not have to be the same as the language
377
# keyword --- those with documents in Polish (whose net-standard
378
# language code is pl) may wish to use "AddLanguage pl .po" to
379
# avoid the ambiguity with the common suffix for perl scripts.
381
# Note 2: The example entries below illustrate that in some cases
382
# the two character 'Language' abbreviation is not identical to
383
# the two character 'Country' code for its country,
384
# E.g. 'Danmark/dk' versus 'Danish/da'.
386
# Note 3: In the case of 'ltz' we violate the RFC by using a three char
387
# specifier. There is 'work in progress' to fix this and get
388
# the reference data for rfc1766 cleaned up.
390
# Catalan (ca) - Croatian (hr) - Czech (cs) - Danish (da) - Dutch (nl)
391
# English (en) - Esperanto (eo) - Estonian (et) - French (fr) - German (de)
392
# Greek-Modern (el) - Hebrew (he) - Italian (it) - Japanese (ja)
393
# Korean (ko) - Luxembourgeois* (ltz) - Norwegian Nynorsk (nn)
394
# Norwegian (no) - Polish (pl) - Portugese (pt)
395
# Brazilian Portuguese (pt-BR) - Russian (ru) - Swedish (sv)
396
# Simplified Chinese (zh-CN) - Spanish (es) - Traditional Chinese (zh-TW)
399
AddLanguage cs .cz .cs
419
AddLanguage pt-BR .pt-br
422
AddLanguage zh-CN .zh-cn
423
AddLanguage zh-TW .zh-tw
426
<IfModule mod_negotiation.c>
428
# LanguagePriority allows you to give precedence to some languages
429
# in case of a tie during content negotiation.
431
# Just list the languages in decreasing order of preference. We have
432
# more or less alphabetized them here. You probably want to change this.
434
LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW
437
# ForceLanguagePriority allows you to serve a result page rather than
438
# MULTIPLE CHOICES (Prefer) [in case of a tie] or NOT ACCEPTABLE (Fallback)
439
# [in case no accepted languages matched the available variants]
441
ForceLanguagePriority Prefer Fallback
445
<IfModule mod_mime.c>
447
# Commonly used filename extensions to character sets. You probably
448
# want to avoid clashes with the language extensions, unless you
449
# are good at carefully testing your setup after each change.
450
# See http://www.iana.org/assignments/character-sets for the
451
# official list of charset names and their respective RFCs.
453
AddCharset us-ascii .ascii .us-ascii
454
AddCharset ISO-8859-1 .iso8859-1 .latin1
455
AddCharset ISO-8859-2 .iso8859-2 .latin2 .cen
456
AddCharset ISO-8859-3 .iso8859-3 .latin3
457
AddCharset ISO-8859-4 .iso8859-4 .latin4
458
AddCharset ISO-8859-5 .iso8859-5 .cyr .iso-ru
459
AddCharset ISO-8859-6 .iso8859-6 .arb .arabic
460
AddCharset ISO-8859-7 .iso8859-7 .grk .greek
461
AddCharset ISO-8859-8 .iso8859-8 .heb .hebrew
462
AddCharset ISO-8859-9 .iso8859-9 .latin5 .trk
463
AddCharset ISO-8859-10 .iso8859-10 .latin6
464
AddCharset ISO-8859-13 .iso8859-13
465
AddCharset ISO-8859-14 .iso8859-14 .latin8
466
AddCharset ISO-8859-15 .iso8859-15 .latin9
467
AddCharset ISO-8859-16 .iso8859-16 .latin10
468
AddCharset ISO-2022-JP .iso2022-jp .jis
469
AddCharset ISO-2022-KR .iso2022-kr .kis
470
AddCharset ISO-2022-CN .iso2022-cn .cis
471
AddCharset Big5 .Big5 .big5 .b5
472
AddCharset cn-Big5 .cn-big5
473
# For russian, more than one charset is used (depends on client, mostly):
474
AddCharset WINDOWS-1251 .cp-1251 .win-1251
475
AddCharset CP866 .cp866
476
AddCharset KOI8 .koi8
477
AddCharset KOI8-E .koi8-e
478
AddCharset KOI8-r .koi8-r .koi8-ru
479
AddCharset KOI8-U .koi8-u
480
AddCharset KOI8-ru .koi8-uk .ua
481
AddCharset ISO-10646-UCS-2 .ucs2
482
AddCharset ISO-10646-UCS-4 .ucs4
483
AddCharset UTF-7 .utf7
484
AddCharset UTF-8 .utf8
485
AddCharset UTF-16 .utf16
486
AddCharset UTF-16BE .utf16be
487
AddCharset UTF-16LE .utf16le
488
AddCharset UTF-32 .utf32
489
AddCharset UTF-32BE .utf32be
490
AddCharset UTF-32LE .utf32le
491
AddCharset euc-cn .euc-cn
492
AddCharset euc-gb .euc-gb
493
AddCharset euc-jp .euc-jp
494
AddCharset euc-kr .euc-kr
495
#Not sure how euc-tw got in - IANA doesn't list it???
496
AddCharset EUC-TW .euc-tw
497
AddCharset gb2312 .gb2312 .gb
498
AddCharset iso-10646-ucs-2 .ucs-2 .iso-10646-ucs-2
499
AddCharset iso-10646-ucs-4 .ucs-4 .iso-10646-ucs-4
500
AddCharset shift_jis .shift_jis .sjis
503
# AddHandler allows you to map certain file extensions to "handlers":
504
# actions unrelated to filetype. These can be either built into the server
505
# or added with the Action directive (see below)
507
# To use CGI scripts outside of ScriptAliased directories:
508
# (You will also need to add "ExecCGI" to the "Options" directive.)
510
#AddHandler cgi-script .cgi
513
# For files that include their own HTTP headers:
515
#AddHandler send-as-is asis
518
# For server-parsed imagemap files:
520
#AddHandler imap-file map
523
# For type maps (negotiated resources):
524
# (This is enabled by default to allow the Apache "It Worked" page
525
# to be distributed in multiple languages.)
527
AddHandler type-map var
530
# Filters allow you to process content before it is sent to the client.
532
# To parse .shtml files for server-side includes (SSI):
533
# (You will also need to add "Includes" to the "Options" directive.)
535
AddType text/html .shtml
536
AddOutputFilter INCLUDES .shtml
540
# Action lets you define media types that will execute a script whenever
541
# a matching file is called. This eliminates the need for repeated URL
542
# pathnames for oft-used CGI file processors.
543
# Format: Action media/type /cgi-script/location
544
# Format: Action handler-name /cgi-script/location
548
# Customizable error responses come in three flavors:
549
# 1) plain text 2) local redirects 3) external redirects
552
#ErrorDocument 500 "The server made a boo boo."
553
#ErrorDocument 404 /missing.html
554
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
555
#ErrorDocument 402 http://www.example.com/subscription_info.html
559
# Putting this all together, we can internationalize error responses.
561
# We use Alias to redirect any /error/HTTP_<error>.html.var response to
562
# our collection of by-error message multi-language collections. We use
563
# includes to substitute the appropriate text.
565
# You can modify the messages' appearance without changing any of the
566
# default HTTP_<error>.html.var files by adding the line:
568
# Alias /error/include/ "/your/include/path/"
570
# which allows you to create your own set of files by starting with the
571
# /usr/share/apache2/error/include/ files and copying them to /your/include/path/,
572
# even on a per-VirtualHost basis. The default include files will display
573
# your Apache version number and your ServerAdmin email address regardless
574
# of the setting of ServerSignature.
576
# The internationalized error documents require mod_alias, mod_include
577
# and mod_negotiation. To activate them, uncomment the following 30 lines.
579
# Alias /error/ "/usr/share/apache2/error/"
581
# <Directory "/usr/share/apache2/error">
583
# Options IncludesNoExec
584
# AddOutputFilter Includes html
585
# AddHandler type-map var
588
# LanguagePriority en cs de es fr it nl sv pt-br ro
589
# ForceLanguagePriority Prefer Fallback
592
# ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
593
# ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
594
# ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
595
# ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
596
# ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
597
# ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
598
# ErrorDocument 410 /error/HTTP_GONE.html.var
599
# ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
600
# ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
601
# ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
602
# ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
603
# ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
604
# ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
605
# ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
606
# ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
607
# ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
608
# ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var
610
<IfModule mod_setenvif.c>
612
# The following directives modify normal HTTP response behavior to
613
# handle known problems with browser implementations.
615
BrowserMatch "Mozilla/2" nokeepalive
616
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
617
BrowserMatch "RealPlayer 4\.0" force-response-1.0
618
BrowserMatch "Java/1\.0" force-response-1.0
619
BrowserMatch "JDK/1\.0" force-response-1.0
622
# The following directive disables redirects on non-GET requests for
623
# a directory that does not include the trailing slash. This fixes a
624
# problem with Microsoft WebFolders which does not appropriately handle
625
# redirects for folders with DAV methods.
626
# Same deal with Apple's DAV filesystem and Gnome VFS support for DAV.
628
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
629
BrowserMatch "^WebDrive" redirect-carefully
630
BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
631
BrowserMatch "^gnome-vfs/1.0" redirect-carefully
632
BrowserMatch "^XML Spy" redirect-carefully
635
#<IfModule mod_status.c>
637
# Allow server status reports generated by mod_status,
638
# with the URL of http://servername/server-status
639
# Change the ".example.com" to match your domain to enable.
641
#<Location /server-status>
642
# SetHandler server-status
645
# Allow from .example.com
649
#<IfModule mod_info.c>
651
# Allow remote server configuration reports, with the URL of
652
# http://servername/server-info (requires that mod_info.c be loaded).
653
# Change the ".example.com" to match your domain to enable.
655
#<Location /server-info>
656
# SetHandler server-info
659
# Allow from .example.com
663
# Include the virtual host configurations:
664
Include /etc/apache2/sites-enabled/[^.#]*