1#
2# This is the main Apache HTTP server configuration file.  It contains the
3# configuration directives that give the server its instructions.
4# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
5# In particular, see 
6# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
7# for a discussion of each configuration directive.
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# Configuration and logfile names: If the filenames you specify for many
14# of the server's control files begin with "/" (or "drive:/" for Win32), the
15# server will use that explicit path.  If the filenames do *not* begin
16# with "/", the value of ServerRoot is prepended -- so "logs/access_log"
17# with ServerRoot set to "/usr/local/apache2" will be interpreted by the
18# server as "/usr/local/apache2/logs/access_log", whereas "/logs/access_log" 
19# will be interpreted as '/logs/access_log'.
20
21#
22# ServerRoot: The top of the directory tree under which the server's
23# configuration, error, and log files are kept.
24#
25# Do not add a slash at the end of the directory path.  If you point
26# ServerRoot at a non-local disk, be sure to specify a local disk on the
27# Mutex directive, if file-based mutexes are used.  If you wish to share the
28# same ServerRoot for multiple httpd daemons, you will need to change at
29# least PidFile.
30#
31ServerRoot "@@ServerRoot@@"
32
33#
34# Mutex: Allows you to set the mutex mechanism and mutex file directory
35# for individual mutexes, or change the global defaults
36#
37# Uncomment and change the directory if mutexes are file-based and the default
38# mutex file directory is not on a local disk or is not appropriate for some
39# other reason.
40#
41# Mutex default:@rel_runtimedir@
42
43#
44# Listen: Allows you to bind Apache to specific IP addresses and/or
45# ports, instead of the default. See also the <VirtualHost>
46# directive.
47#
48# Change this to Listen on specific IP addresses as shown below to 
49# prevent Apache from glomming onto all bound IP addresses.
50#
51#Listen 12.34.56.78:80
52Listen @@Port@@
53
54#
55# Dynamic Shared Object (DSO) Support
56#
57# To be able to use the functionality of a module which was built as a DSO you
58# have to place corresponding `LoadModule' lines at this location so the
59# directives contained in it are actually available _before_ they are used.
60# Statically compiled modules (those listed by `httpd -l') do not need
61# to be loaded here.
62#
63# Example:
64# LoadModule foo_module modules/mod_foo.so
65#
66@@LoadModule@@
67#LoadModule php5_module libexec/apache2/libphp5.so
68#LoadModule hfs_apple_module libexec/apache2/mod_hfs_apple.so
69
70<IfModule unixd_module>
71#
72# If you wish httpd to run as a different user or group, you must run
73# httpd as root initially and it will switch.  
74#
75# User/Group: The name (or #number) of the user/group to run httpd as.
76# It is usually good practice to create a dedicated user and group for
77# running httpd, as with most system services.
78#
79User _www
80Group _www
81
82</IfModule>
83
84# 'Main' server configuration
85#
86# The directives in this section set up the values used by the 'main'
87# server, which responds to any requests that aren't handled by a
88# <VirtualHost> definition.  These values also provide defaults for
89# any <VirtualHost> containers you may define later in the file.
90#
91# All of these directives may appear inside <VirtualHost> containers,
92# in which case these default settings will be overridden for the
93# virtual host being defined.
94#
95
96#
97# ServerAdmin: Your address, where problems with the server should be
98# e-mailed.  This address appears on some server-generated pages, such
99# as error documents.  e.g. admin@your-domain.com
100#
101ServerAdmin you@example.com
102
103#
104# ServerName gives the name and port that the server uses to identify itself.
105# This can often be determined automatically, but we recommend you specify
106# it explicitly to prevent problems during startup.
107#
108# If your host doesn't have a registered DNS name, enter its IP address here.
109#
110#ServerName www.example.com:@@Port@@
111
112#
113# Deny access to the entirety of your server's filesystem. You must
114# explicitly permit access to web content directories in other 
115# <Directory> blocks below.
116#
117<Directory />
118    AllowOverride none
119    Require all denied
120</Directory>
121
122#
123# Note that from this point forward you must specifically allow
124# particular features to be enabled - so if something's not working as
125# you might expect, make sure that you have specifically enabled it
126# below.
127#
128
129#
130# DocumentRoot: The directory out of which you will serve your
131# documents. By default, all requests are taken from this directory, but
132# symbolic links and aliases may be used to point to other locations.
133#
134DocumentRoot "@exp_htdocsdir@"
135<Directory "@exp_htdocsdir@">
136    #
137    # Possible values for the Options directive are "None", "All",
138    # or any combination of:
139    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
140    #
141    # Note that "MultiViews" must be named *explicitly* --- "Options All"
142    # doesn't give it to you.
143    #
144    # The Options directive is both complicated and important.  Please see
145    # http://httpd.apache.org/docs/2.4/mod/core.html#options
146    # for more information.
147    #
148    Options FollowSymLinks Multiviews
149    MultiviewsMatch Any
150
151    #
152    # AllowOverride controls what directives may be placed in .htaccess files.
153    # It can be "All", "None", or any combination of the keywords:
154    #   AllowOverride FileInfo AuthConfig Limit
155    #
156    AllowOverride None
157
158    #
159    # Controls who can get stuff from this server.
160    #
161    Require all granted
162</Directory>
163
164#
165# DirectoryIndex: sets the file that Apache will serve if a directory
166# is requested.
167#
168<IfModule dir_module>
169    DirectoryIndex index.html
170</IfModule>
171
172#
173# The following lines prevent .htaccess and .htpasswd files from being 
174# viewed by Web clients. 
175#
176<FilesMatch "^\.([Hh][Tt]|[Dd][Ss]_[Ss])">
177    Require all denied
178</FilesMatch>
179
180#
181# Apple specific filesystem protection.
182#
183<Files "rsrc">
184    Require all denied
185</Files>
186<DirectoryMatch ".*\.\.namedfork">
187    Require all denied
188</DirectoryMatch>
189
190#
191# ErrorLog: The location of the error log file.
192# If you do not specify an ErrorLog directive within a <VirtualHost>
193# container, error messages relating to that virtual host will be
194# logged here.  If you *do* define an error logfile for a <VirtualHost>
195# container, that host's errors will be logged there and not here.
196#
197ErrorLog "@rel_logfiledir@/error_log"
198
199#
200# LogLevel: Control the number of messages logged to the error_log.
201# Possible values include: debug, info, notice, warn, error, crit,
202# alert, emerg.
203#
204LogLevel warn
205
206<IfModule log_config_module>
207    #
208    # The following directives define some format nicknames for use with
209    # a CustomLog directive (see below).
210    #
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
214    <IfModule logio_module>
215      # You need to enable mod_logio.c to use %I and %O
216      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
217    </IfModule>
218
219    #
220    # The location and format of the access logfile (Common Logfile Format).
221    # If you do not define any access logfiles within a <VirtualHost>
222    # container, they will be logged here.  Contrariwise, if you *do*
223    # define per-<VirtualHost> access logfiles, transactions will be
224    # logged therein and *not* in this file.
225    #
226    CustomLog "@rel_logfiledir@/access_log" common
227
228    #
229    # If you prefer a logfile with access, agent, and referer information
230    # (Combined Logfile Format) you can use the following directive.
231    #
232    #CustomLog "@rel_logfiledir@/access_log" combined
233</IfModule>
234
235<IfModule alias_module>
236    #
237    # Redirect: Allows you to tell clients about documents that used to 
238    # exist in your server's namespace, but do not anymore. The client 
239    # will make a new request for the document at its new location.
240    # Example:
241    # Redirect permanent /foo http://www.example.com/bar
242
243    #
244    # Alias: Maps web paths into filesystem paths and is used to
245    # access content that does not live under the DocumentRoot.
246    # Example:
247    # Alias /webpath /full/filesystem/path
248    #
249    # If you include a trailing / on /webpath then the server will
250    # require it to be present in the URL.  You will also likely
251    # need to provide a <Directory> section to allow access to
252    # the filesystem path.
253
254    #
255    # ScriptAlias: This controls which directories contain server scripts. 
256    # ScriptAliases are essentially the same as Aliases, except that
257    # documents in the target directory are treated as applications and
258    # run by the server when requested rather than as documents sent to the
259    # client.  The same rules about trailing "/" apply to ScriptAlias
260    # directives as to Alias.
261    #
262    ScriptAliasMatch ^/cgi-bin/((?!(?i:webobjects)).*$) "@exp_cgidir@/$1"
263
264</IfModule>
265
266<IfModule cgid_module>
267    #
268    # ScriptSock: On threaded servers, designate the path to the UNIX
269    # socket used to communicate with the CGI daemon of mod_cgid.
270    #
271    #Scriptsock cgisock
272</IfModule>
273
274#
275# "@exp_cgidir@" should be changed to whatever your ScriptAliased
276# CGI directory exists, if you have that configured.
277#
278<Directory "@exp_cgidir@">
279    AllowOverride None
280    Options None
281    Require all granted
282</Directory>
283
284<IfModule mime_module>
285    #
286    # TypesConfig points to the file containing the list of mappings from
287    # filename extension to MIME-type.
288    #
289    TypesConfig @rel_sysconfdir@/mime.types
290
291    #
292    # AddType allows you to add to or override the MIME configuration
293    # file specified in TypesConfig for specific file types.
294    #
295    #AddType application/x-gzip .tgz
296    #
297    # AddEncoding allows you to have certain browsers uncompress
298    # information on the fly. Note: Not all browsers support this.
299    #
300    #AddEncoding x-compress .Z
301    #AddEncoding x-gzip .gz .tgz
302    #
303    # If the AddEncoding directives above are commented-out, then you
304    # probably should define those extensions to indicate media types:
305    #
306    AddType application/x-compress .Z
307    AddType application/x-gzip .gz .tgz
308
309    #
310    # AddHandler allows you to map certain file extensions to "handlers":
311    # actions unrelated to filetype. These can be either built into the server
312    # or added with the Action directive (see below)
313    #
314    # To use CGI scripts outside of ScriptAliased directories:
315    # (You will also need to add "ExecCGI" to the "Options" directive.)
316    #
317    #AddHandler cgi-script .cgi
318
319    # For type maps (negotiated resources):
320    #AddHandler type-map var
321
322    #
323    # Filters allow you to process content before it is sent to the client.
324    #
325    # To parse .shtml files for server-side includes (SSI):
326    # (You will also need to add "Includes" to the "Options" directive.)
327    #
328    #AddType text/html .shtml
329    #AddOutputFilter INCLUDES .shtml
330</IfModule>
331
332#
333# The mod_mime_magic module allows the server to use various hints from the
334# contents of the file itself to determine its type.  The MIMEMagicFile
335# directive tells the module where the hint definitions are located.
336#
337#MIMEMagicFile @rel_sysconfdir@/magic
338
339#
340# Customizable error responses come in three flavors:
341# 1) plain text 2) local redirects 3) external redirects
342#
343# Some examples:
344#ErrorDocument 500 "The server made a boo boo."
345#ErrorDocument 404 /missing.html
346#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
347#ErrorDocument 402 http://www.example.com/subscription_info.html
348#
349
350#
351# MaxRanges: Maximum number of Ranges in a request before
352# returning the entire resource, or one of the special
353# values 'default', 'none' or 'unlimited'.
354# Default setting is to accept 200 Ranges.
355#MaxRanges unlimited
356
357#
358# EnableMMAP and EnableSendfile: On systems that support it, 
359# memory-mapping or the sendfile syscall may be used to deliver
360# files.  This usually improves server performance, but must
361# be turned off when serving from networked-mounted 
362# filesystems or if support for these functions is otherwise
363# broken on your system.
364# Defaults: EnableMMAP On, EnableSendfile Off
365#
366#EnableMMAP off
367#EnableSendfile on
368
369TraceEnable off
370
371# Supplemental configuration
372#
373# The configuration files in the @rel_sysconfdir@/extra/ directory can be 
374# included to add extra features or to modify the default configuration of 
375# the server, or you may simply copy their contents here and change as 
376# necessary.
377
378# Server-pool management (MPM specific)
379Include @rel_sysconfdir@/extra/httpd-mpm.conf
380
381# Multi-language error messages
382#Include @rel_sysconfdir@/extra/httpd-multilang-errordoc.conf
383
384# Fancy directory listings
385Include @rel_sysconfdir@/extra/httpd-autoindex.conf
386
387# Language settings
388#Include @rel_sysconfdir@/extra/httpd-languages.conf
389
390# User home directories
391#Include @rel_sysconfdir@/extra/httpd-userdir.conf
392
393# Real-time info on requests and configuration
394#Include @rel_sysconfdir@/extra/httpd-info.conf
395
396# Virtual hosts
397#Include @rel_sysconfdir@/extra/httpd-vhosts.conf
398
399# Local access to the Apache HTTP Server Manual
400#Include @rel_sysconfdir@/extra/httpd-manual.conf
401
402# Distributed authoring and versioning (WebDAV)
403#Include @rel_sysconfdir@/extra/httpd-dav.conf
404
405# Various default settings
406#Include @rel_sysconfdir@/extra/httpd-default.conf
407
408# Configure mod_proxy_html to understand HTML4/XHTML1
409<IfModule proxy_html_module>
410Include @rel_sysconfdir@/extra/proxy-html.conf
411</IfModule>
412
413# Secure (SSL/TLS) connections
414#Include @rel_sysconfdir@/extra/httpd-ssl.conf
415#
416# Note: The following must must be present to support
417#       starting without SSL on platforms with no /dev/random equivalent
418#       but a statically compiled-in mod_ssl.
419#
420<IfModule ssl_module>
421SSLRandomSeed startup builtin
422SSLRandomSeed connect builtin
423</IfModule>
424
425Include @rel_sysconfdir@/other/*.conf
426
427#
428# uncomment out the below to deal with user agents that deliberately
429# violate open standards by misusing DNT (DNT *must* be a specific
430# end-user choice)
431#
432#<IfModule setenvif_module>
433#BrowserMatch "MSIE 10.0;" bad_DNT
434#</IfModule>
435#<IfModule headers_module>
436#RequestHeader unset DNT env=bad_DNT
437#</IfModule>
438
439