Project

General

Profile

Defect #8551 » apache2.conf

Jérémy Chatard, 2011-06-23 15:07

 
1
#
2
# Based upon the NCSA server configuration files originally by Rob McCool.
3
#
4
# This is the main Apache server configuration file.  It contains the
5
# configuration directives that give the server its instructions.
6
# See http://httpd.apache.org/docs/2.2/ for detailed information about
7
# the directives.
8
#
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.  
12
#
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.
23
#
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".
30
#
31

    
32
### Section 1: Global Environment
33
#
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.
37
#
38

    
39
#
40
# ServerRoot: The top of the directory tree under which the server's
41
# configuration, error, and log files are kept.
42
#
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.
47
#
48
# Do NOT add a slash at the end of the directory path.
49
#
50
ServerRoot "/etc/apache2"
51

    
52
#
53
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
54
#
55
#<IfModule !mpm_winnt.c>
56
#<IfModule !mpm_netware.c>
57
LockFile /var/lock/apache2/accept.lock
58
#</IfModule>
59
#</IfModule>
60

    
61
#
62
# PidFile: The file in which the server should record its process
63
# identification number when it starts.
64
# This needs to be set in /etc/apache2/envvars
65
#
66
PidFile ${APACHE_PID_FILE}
67

    
68
#
69
# Timeout: The number of seconds before receives and sends time out.
70
#
71
Timeout 300
72

    
73
#
74
# KeepAlive: Whether or not to allow persistent connections (more than
75
# one request per connection). Set to "Off" to deactivate.
76
#
77
KeepAlive On
78

    
79
#
80
# MaxKeepAliveRequests: The maximum number of requests to allow
81
# during a persistent connection. Set to 0 to allow an unlimited amount.
82
# We recommend you leave this number high, for maximum performance.
83
#
84
MaxKeepAliveRequests 100
85

    
86
#
87
# KeepAliveTimeout: Number of seconds to wait for the next request from the
88
# same client on the same connection.
89
#
90
KeepAliveTimeout 15
91

    
92
##
93
## Server-Pool Size Regulation (MPM specific)
94
## 
95

    
96
# prefork MPM
97
# StartServers: number of server processes to start
98
# MinSpareServers: minimum number of server processes which are kept spare
99
# MaxSpareServers: maximum number of server processes which are kept spare
100
# MaxClients: maximum number of server processes allowed to start
101
# MaxRequestsPerChild: maximum number of requests a server process serves
102
<IfModule mpm_prefork_module>
103
    StartServers          5
104
    MinSpareServers       5
105
    MaxSpareServers      10
106
    MaxClients          150
107
    MaxRequestsPerChild   0
108
</IfModule>
109

    
110
# worker MPM
111
# StartServers: initial number of server processes to start
112
# MaxClients: maximum number of simultaneous client connections
113
# MinSpareThreads: minimum number of worker threads which are kept spare
114
# MaxSpareThreads: maximum number of worker threads which are kept spare
115
# ThreadsPerChild: constant number of worker threads in each server process
116
# MaxRequestsPerChild: maximum number of requests a server process serves
117
<IfModule mpm_worker_module>
118
    StartServers          2
119
    MaxClients          150
120
    MinSpareThreads      25
121
    MaxSpareThreads      75 
122
    ThreadsPerChild      25
123
    MaxRequestsPerChild   0
124
</IfModule>
125

    
126
# These need to be set in /etc/apache2/envvars
127
User ${APACHE_RUN_USER}
128
Group ${APACHE_RUN_GROUP}
129

    
130
#
131
# AccessFileName: The name of the file to look for in each directory
132
# for additional configuration directives.  See also the AllowOverride
133
# directive.
134
#
135

    
136
AccessFileName .htaccess
137

    
138
#
139
# The following lines prevent .htaccess and .htpasswd files from being 
140
# viewed by Web clients. 
141
#
142
<Files ~ "^\.ht">
143
    Order allow,deny
144
    Deny from all
145
</Files>
146

    
147
#
148
# DefaultType is the default MIME type the server will use for a document
149
# if it cannot otherwise determine one, such as from filename extensions.
150
# If your server contains mostly text or HTML documents, "text/plain" is
151
# a good value.  If most of your content is binary, such as applications
152
# or images, you may want to use "application/octet-stream" instead to
153
# keep browsers from trying to display binary files as though they are
154
# text.
155
#
156
DefaultType text/plain
157

    
158

    
159
#
160
# HostnameLookups: Log the names of clients or just their IP addresses
161
# e.g., www.apache.org (on) or 204.62.129.132 (off).
162
# The default is off because it'd be overall better for the net if people
163
# had to knowingly turn this feature on, since enabling it means that
164
# each client request will result in AT LEAST one lookup request to the
165
# nameserver.
166
#
167
HostnameLookups Off
168

    
169
# ErrorLog: The location of the error log file.
170
# If you do not specify an ErrorLog directive within a <VirtualHost>
171
# container, error messages relating to that virtual host will be
172
# logged here.  If you *do* define an error logfile for a <VirtualHost>
173
# container, that host's errors will be logged there and not here.
174
#
175
#ErrorLog /var/log/apache2/error.log
176
ErrorLog /home/log/apache2/error.log
177

    
178
#
179
# LogLevel: Control the number of messages logged to the error_log.
180
# Possible values include: debug, info, notice, warn, error, crit,
181
# alert, emerg.
182
#
183
LogLevel warn
184

    
185
# Include module configuration:
186
Include /etc/apache2/mods-enabled/*.load
187
Include /etc/apache2/mods-enabled/*.conf
188

    
189
# Include all the user configurations:
190
Include /etc/apache2/httpd.conf
191

    
192
# Include ports listing
193
Include /etc/apache2/ports.conf
194

    
195
#
196
# The following directives define some format nicknames for use with
197
# a CustomLog directive (see below).
198
# If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
199
#
200
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
201
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
202
LogFormat "%h %l %u %t \"%r\" %>s %b" common
203
LogFormat "%{Referer}i -> %U" referer
204
LogFormat "%{User-agent}i" agent
205

    
206
#
207
# Define an access log for VirtualHosts that don't define their own logfile
208
CustomLog /home/log/apache2/other_vhosts_access.log vhost_combined
209

    
210
#
211
# Customizable error responses come in three flavors:
212
# 1) plain text 2) local redirects 3) external redirects
213
#
214
# Some examples:
215
#ErrorDocument 500 "The server made a boo boo."
216
#ErrorDocument 404 /missing.html
217
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
218
#ErrorDocument 402 http://www.example.com/subscription_info.html
219
#
220

    
221
#
222
# Putting this all together, we can internationalize error responses.
223
#
224
# We use Alias to redirect any /error/HTTP_<error>.html.var response to
225
# our collection of by-error message multi-language collections.  We use 
226
# includes to substitute the appropriate text.
227
#
228
# You can modify the messages' appearance without changing any of the
229
# default HTTP_<error>.html.var files by adding the line:
230
#
231
#   Alias /error/include/ "/your/include/path/"
232
#
233
# which allows you to create your own set of files by starting with the
234
# /usr/share/apache2/error/include/ files and copying them to /your/include/path/, 
235
# even on a per-VirtualHost basis.  The default include files will display
236
# your Apache version number and your ServerAdmin email address regardless
237
# of the setting of ServerSignature.
238
#
239
# The internationalized error documents require mod_alias, mod_include
240
# and mod_negotiation.  To activate them, uncomment the following 30 lines.
241

    
242
#    Alias /error/ "/usr/share/apache2/error/"
243
#
244
#    <Directory "/usr/share/apache2/error">
245
#        AllowOverride None
246
#        Options IncludesNoExec
247
#        AddOutputFilter Includes html
248
#        AddHandler type-map var
249
#        Order allow,deny
250
#        Allow from all
251
#        LanguagePriority en cs de es fr it nl sv pt-br ro
252
#        ForceLanguagePriority Prefer Fallback
253
#    </Directory>
254
#
255
#    ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
256
#    ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
257
#    ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
258
#    ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
259
#    ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
260
#    ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
261
#    ErrorDocument 410 /error/HTTP_GONE.html.var
262
#    ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
263
#    ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
264
#    ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
265
#    ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
266
#    ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
267
#    ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
268
#    ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
269
#    ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
270
#    ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
271
#    ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var
272

    
273

    
274

    
275
# Include of directories ignores editors' and dpkg's backup files,
276
# see README.Debian for details.
277

    
278
# Include generic snippets of statements
279
Include /etc/apache2/conf.d/
280

    
281
# Include the virtual host configurations:
282
Include /etc/apache2/sites-enabled/
283
NameVirtualHost x.x.x.x:80
284
NameVirtualHost x.x.x.x:443
285

    
286
Alias /manual /usr/share/doc/apache2-doc/manual/
287

    
288
# Include generic snippets of statements
289
## --> Include /etc/apache2/conf.d/
290

    
291
<Directory "/usr/share/doc/apache2-doc/manual/">
292
    Options Indexes FollowSymlinks
293
    AllowOverride None
294
    Order allow,deny
295
    Allow from all
296
    AddDefaultCharset off
297
</Directory>
298

    
299
# Read the documentation before enabling AddDefaultCharset.
300
# In general, it is only a good idea if you know that all your files
301
# have this encoding. It will override any encoding given in the files
302
# in meta http-equiv or xml encoding tags.
303

    
304
#AddDefaultCharset UTF-8
305

    
306
#
307
# Disable access to the entire file system except for the directories that
308
# are explicitly allowed later.
309
#
310
# This currently breaks the configurations that come with some web application
311
# Debian packages. It will be made the default for the release after lenny.
312
#
313
#<Directory />
314
#	AllowOverride None
315
#	Order Deny,Allow
316
#	Deny from all
317
#</Directory>
318

    
319

    
320
# Changing the following options will not really affect the security of the
321
# server, but might make attacks slightly more difficult in some cases.
322

    
323
#
324
# ServerTokens
325
# This directive configures what you return as the Server HTTP response
326
# Header. The default is 'Full' which sends information about the OS-Type
327
# and compiled in modules.
328
# Set to one of:  Full | OS | Minimal | Minor | Major | Prod
329
# where Full conveys the most information, and Prod the least.
330
#
331
#ServerTokens Minimal
332
ServerTokens Prod
333

    
334
#
335
# Optionally add a line containing the server version and virtual host
336
# name to server-generated pages (internal error documents, FTP directory
337
# listings, mod_status and mod_info output etc., but not CGI generated
338
# documents or custom error documents).
339
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
340
# Set to one of:  On | Off | EMail
341
#
342
ServerSignature Off
343
#ServerSignature On
344

    
345
#
346
# Allow TRACE method
347
#
348
# Set to "extended" to also reflect the request body (only for testing and
349
# diagnostic purposes).
350
#
351
# Set to one of:  On | Off | extended
352
#
353
#TraceEnable Off
354
TraceEnable On
355

    
356
# Include module configuration:
357
## --> Include /etc/apache2/mods-enabled/*.load
358

    
359

    
360
# a2enmod-note: needs-configuration
361

    
362
#
363
# Action lets you define media types that will execute a script whenever
364
# a matching file is called. This eliminates the need for repeated URL
365
# pathnames for oft-used CGI file processors.
366
# Format: Action media/type /cgi-script/location
367
# Format: Action handler-name /cgi-script/location
368
#
369

    
370
LoadModule actions_module /usr/lib/apache2/modules/mod_actions.so
371
<IfModule alias_module>
372
#
373
# Aliases: Add here as many aliases as you need (with no limit). The format is 
374
# Alias fakename realname
375
#
376
# Note that if you include a trailing / on fakename then the server will
377
# require it to be present in the URL.  So "/icons" isn't aliased in this
378
# example, only "/icons/".  If the fakename is slash-terminated, then the 
379
# realname must also be slash terminated, and if the fakename omits the 
380
# trailing slash, the realname must also omit it.
381
#
382
# We include the /icons/ alias for FancyIndexed directory listings.  If
383
# you do not use FancyIndexing, you may comment this out.
384
#
385
Alias /icons/ "/usr/share/apache2/icons/"
386

    
387
<Directory "/usr/share/apache2/icons">
388
    Options Indexes MultiViews
389
    AllowOverride None
390
    Order allow,deny
391
    Allow from all
392
</Directory>
393

    
394
</IfModule>
395
LoadModule alias_module /usr/lib/apache2/modules/mod_alias.so
396
LoadModule auth_basic_module /usr/lib/apache2/modules/mod_auth_basic.so
397
LoadModule auth_digest_module /usr/lib/apache2/modules/mod_auth_digest.so
398
LoadModule authn_file_module /usr/lib/apache2/modules/mod_authn_file.so
399
LoadModule authz_default_module /usr/lib/apache2/modules/mod_authz_default.so
400
LoadModule authz_groupfile_module /usr/lib/apache2/modules/mod_authz_groupfile.so
401
LoadModule authz_host_module /usr/lib/apache2/modules/mod_authz_host.so
402
LoadModule authz_user_module /usr/lib/apache2/modules/mod_authz_user.so
403
<IfModule mod_autoindex.c>
404
#
405
# Directives controlling the display of server-generated directory listings.
406
#
407

    
408
#
409
# IndexOptions: Controls the appearance of server-generated directory
410
# listings.
411
# Remove/replace the "Charset=UTF-8" if you don't use UTF-8 for your filenames.
412
#
413
IndexOptions FancyIndexing VersionSort HTMLTable NameWidth=* DescriptionWidth=* Charset=UTF-8
414

    
415
#
416
# AddIcon* directives tell the server which icon to show for different
417
# files or filename extensions.  These are only displayed for
418
# FancyIndexed directories.
419
#
420
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip x-bzip2
421

    
422
AddIconByType (TXT,/icons/text.gif) text/*
423
AddIconByType (IMG,/icons/image2.gif) image/*
424
AddIconByType (SND,/icons/sound2.gif) audio/*
425
AddIconByType (VID,/icons/movie.gif) video/*
426

    
427
AddIcon /icons/binary.gif .bin .exe
428
AddIcon /icons/binhex.gif .hqx
429
AddIcon /icons/tar.gif .tar
430
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
431
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
432
AddIcon /icons/a.gif .ps .ai .eps
433
AddIcon /icons/layout.gif .html .shtml .htm .pdf
434
AddIcon /icons/text.gif .txt
435
AddIcon /icons/c.gif .c
436
AddIcon /icons/p.gif .pl .py
437
AddIcon /icons/f.gif .for
438
AddIcon /icons/dvi.gif .dvi
439
AddIcon /icons/uuencoded.gif .uu
440
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
441
AddIcon /icons/tex.gif .tex
442
# It's a suffix rule, so simply matching "core" matches "score" as well !
443
AddIcon /icons/bomb.gif /core
444
AddIcon (SND,/icons/sound2.gif) .ogg
445
AddIcon (VID,/icons/movie.gif) .ogm
446

    
447
AddIcon /icons/back.gif ..
448
AddIcon /icons/hand.right.gif README
449
AddIcon /icons/folder.gif ^^DIRECTORY^^
450
AddIcon /icons/blank.gif ^^BLANKICON^^
451

    
452
# Default icons for OpenDocument format
453
AddIcon /icons/odf6odt-20x22.png .odt
454
AddIcon /icons/odf6ods-20x22.png .ods
455
AddIcon /icons/odf6odp-20x22.png .odp
456
AddIcon /icons/odf6odg-20x22.png .odg
457
AddIcon /icons/odf6odc-20x22.png .odc
458
AddIcon /icons/odf6odf-20x22.png .odf
459
AddIcon /icons/odf6odb-20x22.png .odb
460
AddIcon /icons/odf6odi-20x22.png .odi
461
AddIcon /icons/odf6odm-20x22.png .odm
462

    
463
AddIcon /icons/odf6ott-20x22.png .ott
464
AddIcon /icons/odf6ots-20x22.png .ots
465
AddIcon /icons/odf6otp-20x22.png .otp
466
AddIcon /icons/odf6otg-20x22.png .otg
467
AddIcon /icons/odf6otc-20x22.png .otc
468
AddIcon /icons/odf6otf-20x22.png .otf
469
AddIcon /icons/odf6oti-20x22.png .oti
470
AddIcon /icons/odf6oth-20x22.png .oth
471

    
472
#
473
# DefaultIcon is which icon to show for files which do not have an icon
474
# explicitly set.
475
#
476
DefaultIcon /icons/unknown.gif
477

    
478
#
479
# AddDescription allows you to place a short description after a file in
480
# server-generated indexes.  These are only displayed for FancyIndexed
481
# directories.
482
# Format: AddDescription "description" filename
483
#
484
#AddDescription "GZIP compressed document" .gz
485
#AddDescription "tar archive" .tar
486
#AddDescription "GZIP compressed tar archive" .tgz
487

    
488
#
489
# ReadmeName is the name of the README file the server will look for by
490
# default, and append to directory listings.
491
#
492
# HeaderName is the name of a file which should be prepended to
493
# directory indexes. 
494
ReadmeName README.html
495
HeaderName HEADER.html
496

    
497
#
498
# IndexIgnore is a set of filenames which directory indexing should ignore
499
# and not include in the listing.  Shell-style wildcarding is permitted.
500
#
501
IndexIgnore .??* *~ *# RCS CVS *,v *,t 
502

    
503
</IfModule>
504
LoadModule autoindex_module /usr/lib/apache2/modules/mod_autoindex.so
505
LoadModule cgi_module /usr/lib/apache2/modules/mod_cgi.so
506
DAVLockDB /var/lock/apache2/DAVLock
507
# Depends: dav
508
LoadModule dav_fs_module /usr/lib/apache2/modules/mod_dav_fs.so
509
LoadModule dav_module /usr/lib/apache2/modules/mod_dav.so
510
# dav_svn.conf - Example Subversion/Apache configuration
511
#
512
# For details and further options see the Apache user manual and
513
# the Subversion book.
514
#
515
# NOTE: for a setup with multiple vhosts, you will want to do this
516
# configuration in /etc/apache2/sites-available/*, not here.
517

    
518
# <Location URL> ... </Location>
519
# URL controls how the repository appears to the outside world.
520
# In this example clients access the repository as http://hostname/svn/
521
# Note, a literal /svn should NOT exist in your document root.
522
#<Location /svn>
523

    
524
  # Uncomment this to enable the repository
525
  #DAV svn
526

    
527
  # Set this to the path to your repository
528
  #SVNPath /var/lib/svn
529
  # Alternatively, use SVNParentPath if you have multiple repositories under
530
  # under a single directory (/var/lib/svn/repo1, /var/lib/svn/repo2, ...).
531
  # You need either SVNPath and SVNParentPath, but not both.
532
  #SVNParentPath /var/lib/svn
533

    
534
  # Access control is done at 3 levels: (1) Apache authentication, via
535
  # any of several methods.  A "Basic Auth" section is commented out
536
  # below.  (2) Apache <Limit> and <LimitExcept>, also commented out
537
  # below.  (3) mod_authz_svn is a svn-specific authorization module
538
  # which offers fine-grained read/write access control for paths
539
  # within a repository.  (The first two layers are coarse-grained; you
540
  # can only enable/disable access to an entire repository.)  Note that
541
  # mod_authz_svn is noticeably slower than the other two layers, so if
542
  # you don't need the fine-grained control, don't configure it.
543

    
544
  # Basic Authentication is repository-wide.  It is not secure unless
545
  # you are using https.  See the 'htpasswd' command to create and
546
  # manage the password file - and the documentation for the
547
  # 'auth_basic' and 'authn_file' modules, which you will need for this
548
  # (enable them with 'a2enmod').
549
  #AuthType Basic
550
  #AuthName "Subversion Repository"
551
  #AuthUserFile /etc/apache2/dav_svn.passwd
552

    
553
  # To enable authorization via mod_authz_svn
554
  #AuthzSVNAccessFile /etc/apache2/dav_svn.authz
555

    
556
  # The following three lines allow anonymous read, but make
557
  # committers authenticate themselves.  It requires the 'authz_user'
558
  # module (enable it with 'a2enmod').
559
  #<LimitExcept GET PROPFIND OPTIONS REPORT>
560
    #Require valid-user
561
  #</LimitExcept> 
562

    
563
#</Location>
564
# Depends: dav
565
LoadModule dav_svn_module /usr/lib/apache2/modules/mod_dav_svn.so
566
LoadModule authz_svn_module /usr/lib/apache2/modules/mod_authz_svn.so
567
<IfModule mod_deflate.c>
568
          AddOutputFilterByType DEFLATE text/html text/plain text/xml
569
</IfModule>
570
LoadModule deflate_module /usr/lib/apache2/modules/mod_deflate.so
571
<IfModule mod_dir.c>
572

    
573
          DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
574

    
575
</IfModule>
576
LoadModule dir_module /usr/lib/apache2/modules/mod_dir.so
577
LoadModule env_module /usr/lib/apache2/modules/mod_env.so
578
LoadModule expires_module /usr/lib/apache2/modules/mod_expires.so
579
<IfModule mod_fcgid.c>
580
  AddHandler	fcgid-script .fcgi
581
  IPCConnectTimeout 20
582
</IfModule>
583
LoadModule fcgid_module /usr/lib/apache2/modules/mod_fcgid.so
584
LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so
585
<IfModule mod_mime.c>
586

    
587
#
588
# TypesConfig points to the file containing the list of mappings from
589
# filename extension to MIME-type.
590
#
591
TypesConfig /etc/mime.types
592

    
593
#
594
# AddType allows you to add to or override the MIME configuration
595
# file mime.types for specific file types.
596
#
597
#AddType application/x-gzip .tgz
598
#
599
# AddEncoding allows you to have certain browsers uncompress
600
# information on the fly. Note: Not all browsers support this.
601
# Despite the name similarity, the following Add* directives have
602
# nothing to do with the FancyIndexing customization directives above.
603
#
604
#AddEncoding x-compress .Z
605
#AddEncoding x-gzip .gz .tgz
606
#AddEncoding x-bzip2 .bz2
607
#
608
# If the AddEncoding directives above are commented-out, then you
609
# probably should define those extensions to indicate media types:
610
#
611
AddType application/x-compress .Z
612
AddType application/x-gzip .gz .tgz
613
AddType application/x-bzip2 .bz2
614

    
615
#
616
# DefaultLanguage and AddLanguage allows you to specify the language of 
617
# a document. You can then use content negotiation to give a browser a 
618
# file in a language the user can understand.
619
#
620
# Specify a default language. This means that all data
621
# going out without a specific language tag (see below) will 
622
# be marked with this one. You probably do NOT want to set
623
# this unless you are sure it is correct for all cases.
624
#
625
# * It is generally better to not mark a page as 
626
# * being a certain language than marking it with the wrong
627
# * language!
628
#
629
# DefaultLanguage nl
630
#
631
# Note 1: The suffix does not have to be the same as the language
632
# keyword --- those with documents in Polish (whose net-standard
633
# language code is pl) may wish to use "AddLanguage pl .po" to
634
# avoid the ambiguity with the common suffix for perl scripts.
635
#
636
# Note 2: The example entries below illustrate that in some cases 
637
# the two character 'Language' abbreviation is not identical to 
638
# the two character 'Country' code for its country,
639
# E.g. 'Danmark/dk' versus 'Danish/da'.
640
#
641
# Note 3: In the case of 'ltz' we violate the RFC by using a three char
642
# specifier. There is 'work in progress' to fix this and get
643
# the reference data for rfc1766 cleaned up.
644
#
645
# Catalan (ca) - Croatian (hr) - Czech (cs) - Danish (da) - Dutch (nl)
646
# English (en) - Esperanto (eo) - Estonian (et) - French (fr) - German (de)
647
# Greek-Modern (el) - Hebrew (he) - Italian (it) - Japanese (ja)
648
# Korean (ko) - Luxembourgeois* (ltz) - Norwegian Nynorsk (nn)
649
# Norwegian (no) - Polish (pl) - Portugese (pt)
650
# Brazilian Portuguese (pt-BR) - Russian (ru) - Swedish (sv)
651
# Simplified Chinese (zh-CN) - Spanish (es) - Traditional Chinese (zh-TW)
652
#
653
AddLanguage ca .ca
654
AddLanguage cs .cz .cs
655
AddLanguage da .dk
656
AddLanguage de .de
657
AddLanguage el .el
658
AddLanguage en .en
659
AddLanguage eo .eo
660
# See README.Debian for Spanish
661
AddLanguage es .es
662
AddLanguage et .et
663
AddLanguage fr .fr
664
AddLanguage he .he
665
AddLanguage hr .hr
666
AddLanguage it .it
667
AddLanguage ja .ja
668
AddLanguage ko .ko
669
AddLanguage ltz .ltz
670
AddLanguage nl .nl
671
AddLanguage nn .nn
672
AddLanguage no .no
673
AddLanguage pl .po
674
AddLanguage pt .pt
675
AddLanguage pt-BR .pt-br
676
AddLanguage ru .ru
677
AddLanguage sv .sv
678
# See README.Debian for Turkish
679
AddLanguage tr .tr
680
AddLanguage zh-CN .zh-cn
681
AddLanguage zh-TW .zh-tw
682

    
683
#
684
# Commonly used filename extensions to character sets. You probably
685
# want to avoid clashes with the language extensions, unless you
686
# are good at carefully testing your setup after each change.
687
# See http://www.iana.org/assignments/character-sets for the
688
# official list of charset names and their respective RFCs.
689
#
690
AddCharset us-ascii    .ascii .us-ascii
691
AddCharset ISO-8859-1  .iso8859-1  .latin1
692
AddCharset ISO-8859-2  .iso8859-2  .latin2 .cen
693
AddCharset ISO-8859-3  .iso8859-3  .latin3
694
AddCharset ISO-8859-4  .iso8859-4  .latin4
695
AddCharset ISO-8859-5  .iso8859-5  .cyr .iso-ru
696
AddCharset ISO-8859-6  .iso8859-6  .arb .arabic
697
AddCharset ISO-8859-7  .iso8859-7  .grk .greek
698
AddCharset ISO-8859-8  .iso8859-8  .heb .hebrew
699
AddCharset ISO-8859-9  .iso8859-9  .latin5 .trk
700
AddCharset ISO-8859-10  .iso8859-10  .latin6
701
AddCharset ISO-8859-13  .iso8859-13
702
AddCharset ISO-8859-14  .iso8859-14  .latin8
703
AddCharset ISO-8859-15  .iso8859-15  .latin9
704
AddCharset ISO-8859-16  .iso8859-16  .latin10
705
AddCharset ISO-2022-JP .iso2022-jp .jis
706
AddCharset ISO-2022-KR .iso2022-kr .kis
707
AddCharset ISO-2022-CN .iso2022-cn .cis
708
AddCharset Big5        .Big5       .big5 .b5
709
AddCharset cn-Big5     .cn-big5
710
# For russian, more than one charset is used (depends on client, mostly):
711
AddCharset WINDOWS-1251 .cp-1251   .win-1251
712
AddCharset CP866       .cp866
713
AddCharset KOI8      .koi8
714
AddCharset KOI8-E      .koi8-e
715
AddCharset KOI8-r      .koi8-r .koi8-ru
716
AddCharset KOI8-U      .koi8-u
717
AddCharset KOI8-ru     .koi8-uk .ua
718
AddCharset ISO-10646-UCS-2 .ucs2
719
AddCharset ISO-10646-UCS-4 .ucs4
720
AddCharset UTF-7       .utf7
721
AddCharset UTF-8       .utf8
722
AddCharset UTF-16      .utf16
723
AddCharset UTF-16BE    .utf16be
724
AddCharset UTF-16LE    .utf16le
725
AddCharset UTF-32      .utf32
726
AddCharset UTF-32BE    .utf32be
727
AddCharset UTF-32LE    .utf32le
728
AddCharset euc-cn      .euc-cn
729
AddCharset euc-gb      .euc-gb
730
AddCharset euc-jp      .euc-jp
731
AddCharset euc-kr      .euc-kr
732
#Not sure how euc-tw got in - IANA doesn't list it???
733
AddCharset EUC-TW      .euc-tw
734
AddCharset gb2312      .gb2312 .gb
735
AddCharset iso-10646-ucs-2 .ucs-2 .iso-10646-ucs-2
736
AddCharset iso-10646-ucs-4 .ucs-4 .iso-10646-ucs-4
737
AddCharset shift_jis   .shift_jis .sjis
738

    
739
#
740
# AddHandler allows you to map certain file extensions to "handlers":
741
# actions unrelated to filetype. These can be either built into the server
742
# or added with the Action directive (see below)
743
#
744
# To use CGI scripts outside of ScriptAliased directories:
745
# (You will also need to add "ExecCGI" to the "Options" directive.)
746
#
747
#AddHandler cgi-script .cgi
748

    
749
#
750
# For files that include their own HTTP headers:
751
#
752
#AddHandler send-as-is asis
753

    
754
#
755
# For server-parsed imagemap files:
756
#
757
#AddHandler imap-file map
758

    
759
#
760
# For type maps (negotiated resources):
761
# (This is enabled by default to allow the Apache "It Worked" page
762
#  to be distributed in multiple languages.)
763
#
764
AddHandler type-map var
765

    
766
#
767
# Filters allow you to process content before it is sent to the client.
768
#
769
# To parse .shtml files for server-side includes (SSI):
770
# (You will also need to add "Includes" to the "Options" directive.)
771
#
772
AddType text/html .shtml
773
AddOutputFilter INCLUDES .shtml
774

    
775
</IfModule>
776
LoadModule mime_module /usr/lib/apache2/modules/mod_mime.so
777
<IfModule mod_negotiation.c>
778
#
779
# LanguagePriority allows you to give precedence to some languages
780
# in case of a tie during content negotiation.
781
#
782
# Just list the languages in decreasing order of preference. We have
783
# more or less alphabetized them here. You probably want to change this.
784
#
785
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 tr zh-CN zh-TW
786

    
787
#
788
# ForceLanguagePriority allows you to serve a result page rather than
789
# MULTIPLE CHOICES (Prefer) [in case of a tie] or NOT ACCEPTABLE (Fallback)
790
# [in case no accepted languages matched the available variants]
791
#
792
ForceLanguagePriority Prefer Fallback
793

    
794
</IfModule>
795
LoadModule negotiation_module /usr/lib/apache2/modules/mod_negotiation.so
796
<IfModule pagespeed_module>
797
    # Turn on mod_pagespeed. To completely disable mod_pagespeed, you
798
    # can set this to "off".
799
    ModPagespeed on
800

    
801
    # Direct Apache to send all HTML output to the mod_pagespeed
802
    # output handler.
803
    AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html
804

    
805
    # The ModPagespeedFileCachePath and
806
    # ModPagespeedGeneratedFilePrefix directories must exist and be
807
    # writable by the apache user (as specified by the User
808
    # directive).
809
    ModPagespeedFileCachePath            "/var/mod_pagespeed/cache/"
810
    ModPagespeedGeneratedFilePrefix      "/var/mod_pagespeed/files/"
811

    
812
    # Override the mod_pagespeed 'rewrite level'. The default level
813
    # "CoreFilters" uses a set of rewrite filters that are generally
814
    # safe for most web pages. Most sites should not need to change
815
    # this value and can instead fine-tune the configuration using the
816
    # ModPagespeedDisableFilters and ModPagespeedEnableFilters
817
    # directives, below. Valid values for ModPagespeedRewriteLevel are
818
    # PassThrough, CoreFilters and TestingCoreFilters.
819
    #
820
    # ModPagespeedRewriteLevel PassThrough
821

    
822
    # Explicitly disables specific filters. This is useful in
823
    # conjuction with ModPagespeedRewriteLevel. For instance, if one
824
    # of the filters in the CoreFilters needs to be disabled for a
825
    # site, that filter can be added to
826
    # ModPagespeedDisableFilters. This directive contains a
827
    # comma-separated list of filter names, and can be repeated.
828
    #
829
    # ModPagespeedDisableFilters rewrite_images
830

    
831
    # Explicitly enables specific filters. This is useful in
832
    # conjuction with ModPagespeedRewriteLevel. For instance, filters
833
    # not included in the CoreFilters may be enabled using this
834
    # directive. This directive contains a comma-separated list of
835
    # filter names, and can be repeated.
836
    #
837
    # ModPagespeedEnableFilters rewrite_javascript,rewrite_css
838
    # ModPagespeedEnableFilters collapse_whitespace,elide_attributes
839

    
840
    # ModPagespeedDomain
841
    # authorizes rewriting of JS, CSS, and Image files found in this
842
    # domain. By default only resources with the same origin as the
843
    # HTML file are rewritten. For example:
844
    #
845
    #   ModPagespeedDomain cdn.myhost.com
846
    #
847
    # This will allow resources found on http://cdn.myhost.com to be
848
    # rewritten in addition to those in the same domain as the HTML.
849
    #
850
    # Wildcards (* and ?) are allowed in the domain specification. Be
851
    # careful when using them as if you rewrite domains that do not
852
    # send you traffic, then the site receiving the traffic will not
853
    # know how to serve the rewritten content.
854

    
855
    # Other defaults (cache sizes and thresholds):
856
    #
857
    # ModPagespeedFileCacheSizeKb          102400
858
    # ModPagespeedFileCacheCleanIntervalMs 3600000
859
    # ModPagespeedLRUCacheKbPerProcess     1024
860
    # ModPagespeedLRUCacheByteLimit        16384
861
    # ModPagespeedCssInlineMaxBytes        2048
862
    # ModPagespeedImageInlineMaxBytes      2048
863
    # ModPagespeedJsInlineMaxBytes         2048
864
    # ModPagespeedCssOutlineMinBytes       3000
865
    # ModPagespeedJsOutlineMinBytes        3000
866

    
867
    # Bound the number of images that can be rewritten at any one time; this
868
    # avoids overloading the CPU.  Set this to 0 to remove the bound.
869
    #
870
    # ModPagespeedImageMaxRewritesAtOnce      8
871

    
872
    # When Apache is set up as a browser proxy, mod_pagespeed can record
873
    # web-sites as they are requested, so that an image of the web is built up
874
    # in the directory of the proxy administrator's choosing.  When ReadOnly is
875
    # on, only files already present in the SlurpDirectory are served by the
876
    # proxy.
877
    #
878
    # ModPagespeedSlurpDirectory ...
879
    # ModPagespeedSlurpReadOnly on
880

    
881
    # The maximum URL size is generally limited to about 2k characters
882
    # due to IE: See http://support.microsoft.com/kb/208427/EN-US.
883
    # Apache servers by default impose a further limitation of about
884
    # 250 characters per URL segment (text between slashes).
885
    # mod_pagespeed circumvents this limitation, but if you employ
886
    # proxy servers in your path you may need to re-impose it by
887
    # overriding the setting here.  The default setting is 1024
888
    # characters.
889
    #
890
    # ModPagespeedMaxSegmentLength 250
891

    
892
    # Uncomment this if you want to prevent mod_pagespeed from combining files
893
    # (e.g. CSS files) across paths
894
    #
895
    # ModPagespeedCombineAcrossPaths off
896

    
897

    
898
    # Enables server-side instrumentation and statistics.  If this rewriter is
899
    # enabled, then each rewritten HTML page will have instrumentation javacript
900
    # added that sends latency beacons to /mod_pagespeed_beacon.  These
901
    # statistics can be accessed at /mod_pagespeed_statistics.  You must also
902
    # enable the mod_pagespeed_statistics and mod_pagespeed_beacon handlers
903
    # below.
904
    #
905
    # ModPagespeedEnableFilters add_instrumentation
906

    
907
    # This handles the client-side instrumentation callbacks which are injected
908
    # by the add_instrumentation filter.
909
    # You can use a different location by adding the ModPagespeedBeaconUrl
910
    # directive; see the documentation on add_instrumentation.
911
    <Location /mod_pagespeed_beacon>
912
          SetHandler mod_pagespeed_beacon
913
    </Location>
914

    
915
    # Uncomment the following line if you want to disable statistics entirely.
916
    #
917
    # ModPagespeedStatistics off
918

    
919
    # This page lets you view statistics about the mod_pagespeed module.
920
    <Location /mod_pagespeed_statistics>
921
        Order allow,deny
922
        # You may insert other "Allow from" lines to add hosts you want to
923
        # allow to look at generated statistics.  Another possibility is
924
        # to comment out the "Order" and "Allow" options from the config
925
        # file, to allow any client that can reach your server to examine
926
        # statistics.  This might be appropriate in an experimental setup or
927
        # if the Apache server is protected by a reverse proxy that will
928
        # filter URLs in some fashion.
929
        Allow from localhost
930
        SetHandler mod_pagespeed_statistics
931
    </Location>
932
</IfModule>
933
LoadModule pagespeed_module /usr/lib/apache2/modules/mod_pagespeed.so
934

    
935
# Only attempt to load mod_deflate if it hasn't been loaded already.
936
<IfModule !mod_deflate.c>
937
 LoadModule deflate_module /usr/lib/apache2/modules/mod_deflate.so
938
</IfModule>
939
# Default ruby version
940
#LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.9/ext/apache2/mod_passenger.so
941
#PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.9
942
#PassengerRuby /usr/bin/ruby1.8
943

    
944
# Ruby enterprise version
945
# LoadModule passenger_module /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/passenger-2.2.9/ext/apache2/mod_passenger.so
946
# PassengerRoot /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/passenger-2.2.9
947
# PassengerRuby /opt/ruby-enterprise-1.8.7-2009.10/bin/ruby
948

    
949

    
950
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.7/ext/apache2/mod_passenger.so
951
   PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.7
952
   PassengerRuby /opt/ruby-enterprise-1.8.7-2009.10/bin/ruby<IfModule mod_php5.c>
953
  AddType application/x-httpd-php .php .phtml .php3
954
  AddType application/x-httpd-php-source .phps
955
</IfModule>
956
LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
957
# Depends: proxy
958
LoadModule proxy_balancer_module /usr/lib/apache2/modules/mod_proxy_balancer.so
959
<IfModule mod_proxy.c>
960
        #turning ProxyRequests on and allowing proxying from all may allow
961
        #spammers to use your proxy to send email.
962

    
963
        ProxyRequests Off
964

    
965
        <Proxy *>
966
                AddDefaultCharset off
967
                Order deny,allow
968
                Deny from all
969
                #Allow from .example.com
970
        </Proxy>
971

    
972
        # Enable/disable the handling of HTTP/1.1 "Via:" headers.
973
        # ("Full" adds the server version; "Block" removes all outgoing Via: headers)
974
        # Set to one of: Off | On | Full | Block
975

    
976
        ProxyVia On
977
</IfModule>
978
# Depends: proxy
979
LoadModule proxy_connect_module /usr/lib/apache2/modules/mod_proxy_connect.so
980
# Depends: proxy
981
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so
982
LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
983
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
984
LoadModule ruby_module /usr/lib/apache2/modules/mod_ruby.so
985
<IfModule mod_setenvif.c>
986

    
987
#
988
# The following directives modify normal HTTP response behavior to
989
# handle known problems with browser implementations.
990
#
991
BrowserMatch "Mozilla/2" nokeepalive
992
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
993
BrowserMatch "RealPlayer 4\.0" force-response-1.0
994
BrowserMatch "Java/1\.0" force-response-1.0
995
BrowserMatch "JDK/1\.0" force-response-1.0
996

    
997
#
998
# The following directive disables redirects on non-GET requests for
999
# a directory that does not include the trailing slash.  This fixes a 
1000
# problem with Microsoft WebFolders which does not appropriately handle 
1001
# redirects for folders with DAV methods.
1002
# Same deal with Apple's DAV filesystem and Gnome VFS support for DAV.
1003
#
1004
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
1005
BrowserMatch "MS FrontPage" redirect-carefully
1006
BrowserMatch "^WebDrive" redirect-carefully
1007
BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
1008
BrowserMatch "^gnome-vfs/1.0" redirect-carefully
1009
BrowserMatch "^XML Spy" redirect-carefully
1010
BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully
1011

    
1012
</IfModule>
1013
LoadModule setenvif_module /usr/lib/apache2/modules/mod_setenvif.so
1014
<IfModule mod_ssl.c>
1015
#
1016
# Pseudo Random Number Generator (PRNG):
1017
# Configure one or more sources to seed the PRNG of the SSL library.
1018
# The seed data should be of good random quality.
1019
# WARNING! On some platforms /dev/random blocks if not enough entropy
1020
# is available. This means you then cannot use the /dev/random device
1021
# because it would lead to very long connection times (as long as
1022
# it requires to make more entropy available). But usually those
1023
# platforms additionally provide a /dev/urandom device which doesn't
1024
# block. So, if available, use this one instead. Read the mod_ssl User
1025
# Manual for more details.
1026
#
1027
SSLRandomSeed startup builtin
1028
SSLRandomSeed startup file:/dev/urandom 512
1029
SSLRandomSeed connect builtin
1030
SSLRandomSeed connect file:/dev/urandom 512
1031

    
1032
##
1033
##  SSL Global Context
1034
##
1035
##  All SSL configuration in this context applies both to
1036
##  the main server and all SSL-enabled virtual hosts.
1037
##
1038

    
1039
#
1040
#   Some MIME-types for downloading Certificates and CRLs
1041
#
1042
AddType application/x-x509-ca-cert .crt
1043
AddType application/x-pkcs7-crl    .crl
1044

    
1045
#   Pass Phrase Dialog:
1046
#   Configure the pass phrase gathering process.
1047
#   The filtering dialog program (`builtin' is a internal
1048
#   terminal dialog) has to provide the pass phrase on stdout.
1049
SSLPassPhraseDialog  builtin
1050

    
1051
#   Inter-Process Session Cache:
1052
#   Configure the SSL Session Cache: First the mechanism 
1053
#   to use and second the expiring timeout (in seconds).
1054
#SSLSessionCache         dbm:/var/run/apache2/ssl_scache
1055
SSLSessionCache        shmcb:/var/run/apache2/ssl_scache(512000)
1056
SSLSessionCacheTimeout  300
1057

    
1058
#   Semaphore:
1059
#   Configure the path to the mutual exclusion semaphore the
1060
#   SSL engine uses internally for inter-process synchronization. 
1061
SSLMutex  file:/var/run/apache2/ssl_mutex
1062

    
1063
#   SSL Cipher Suite:
1064
#   List the ciphers that the client is permitted to negotiate.
1065
#   See the mod_ssl documentation for a complete list.
1066
#   enable only secure ciphers:
1067
SSLCipherSuite HIGH:MEDIUM:!ADH
1068
#   Use this instead if you want to allow cipher upgrades via SGC facility.
1069
#   In this case you also have to use something like 
1070
#        SSLRequire %{SSL_CIPHER_USEKEYSIZE} >= 128
1071
#   see http://httpd.apache.org/docs/2.2/ssl/ssl_howto.html.en#upgradeenc
1072
#SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
1073

    
1074
# enable only secure protocols: SSLv3 and TLSv1, but not SSLv2
1075
SSLProtocol all -SSLv2
1076

    
1077
# Allow insecure renegotiation with clients which do not yet support the
1078
# secure renegotiation protocol. Default: Off
1079
#SSLInsecureRenegotiation on
1080

    
1081
</IfModule>
1082
LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so
1083
<IfModule mod_status.c>
1084
#
1085
# Allow server status reports generated by mod_status,
1086
# with the URL of http://servername/server-status
1087
# Uncomment and change the ".example.com" to allow
1088
# access from other hosts.
1089
#
1090
<Location /server-status>
1091
    SetHandler server-status
1092
    Order deny,allow
1093
    Deny from all
1094
    Allow from localhost ip6-localhost
1095
#    Allow from .example.com
1096
</Location>
1097

    
1098
</IfModule>
1099
LoadModule status_module /usr/lib/apache2/modules/mod_status.so
1100
LoadModule suexec_module /usr/lib/apache2/modules/mod_suexec.so
(7-7/7)