blob: 72299592dae5e5af1dafcb4a6a8500ae26d29618 [file] [log] [blame]
Matteo Scandoloeb0d11c2017-08-08 13:05:26 -07001
2{#
3Copyright 2017-present Open Networking Foundation
4
5Licensed under the Apache License, Version 2.0 (the "License");
6you may not use this file except in compliance with the License.
7You may obtain a copy of the License at
8
9http://www.apache.org/licenses/LICENSE-2.0
10
11Unless required by applicable law or agreed to in writing, software
12distributed under the License is distributed on an "AS IS" BASIS,
13WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14See the License for the specific language governing permissions and
15limitations under the License.
16#}
17
18
rdudyalab086cf32016-08-11 00:07:45 -040019# This is the main Apache server configuration file. It contains the
20# configuration directives that give the server its instructions.
21# See http://httpd.apache.org/docs/2.4/ for detailed information about
22# the directives and /usr/share/doc/apache2/README.Debian about Debian specific
23# hints.
24#
25#
26# Summary of how the Apache 2 configuration works in Debian:
27# The Apache 2 web server configuration in Debian is quite different to
28# upstream's suggested way to configure the web server. This is because Debian's
29# default Apache2 installation attempts to make adding and removing modules,
30# virtual hosts, and extra configuration directives as flexible as possible, in
31# order to make automating the changes and administering the server as easy as
32# possible.
33
34# It is split into several files forming the configuration hierarchy outlined
35# below, all located in the /etc/apache2/ directory:
36#
37# /etc/apache2/
38# |-- apache2.conf
39# | `-- ports.conf
40# |-- mods-enabled
41# | |-- *.load
42# | `-- *.conf
43# |-- conf-enabled
44# | `-- *.conf
45# `-- sites-enabled
46# `-- *.conf
47#
48#
49# * apache2.conf is the main configuration file (this file). It puts the pieces
50# together by including all remaining configuration files when starting up the
51# web server.
52#
53# * ports.conf is always included from the main configuration file. It is
54# supposed to determine listening ports for incoming connections which can be
55# customized anytime.
56#
57# * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/
58# directories contain particular configuration snippets which manage modules,
59# global configuration fragments, or virtual host configurations,
60# respectively.
61#
62# They are activated by symlinking available configuration files from their
63# respective *-available/ counterparts. These should be managed by using our
64# helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See
65# their respective man pages for detailed information.
66#
67# * The binary is called apache2. Due to the use of environment variables, in
68# the default configuration, apache2 needs to be started/stopped with
69# /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not
70# work with the default configuration.
71
72
73# Global configuration
74#
75
76#
77# ServerRoot: The top of the directory tree under which the server's
78# configuration, error, and log files are kept.
79#
80# NOTE! If you intend to place this on an NFS (or otherwise network)
81# mounted filesystem then please read the Mutex documentation (available
82# at <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
83# you will save yourself a lot of trouble.
84#
85# Do NOT add a slash at the end of the directory path.
86#
87#ServerRoot "/etc/apache2"
88
89#
90# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
91#
92Mutex file:${APACHE_LOCK_DIR} default
93
94#
95# PidFile: The file in which the server should record its process
96# identification number when it starts.
97# This needs to be set in /etc/apache2/envvars
98#
99PidFile ${APACHE_PID_FILE}
100
101#
102# Timeout: The number of seconds before receives and sends time out.
103#
104Timeout 300
105
106#
107# KeepAlive: Whether or not to allow persistent connections (more than
108# one request per connection). Set to "Off" to deactivate.
109#
110KeepAlive On
111
112#
113# MaxKeepAliveRequests: The maximum number of requests to allow
114# during a persistent connection. Set to 0 to allow an unlimited amount.
115# We recommend you leave this number high, for maximum performance.
116#
117MaxKeepAliveRequests 100
118
119#
120# KeepAliveTimeout: Number of seconds to wait for the next request from the
121# same client on the same connection.
122#
123KeepAliveTimeout 5
124
125
126# These need to be set in /etc/apache2/envvars
127User ${APACHE_RUN_USER}
128Group ${APACHE_RUN_GROUP}
129
130#
131# HostnameLookups: Log the names of clients or just their IP addresses
132# e.g., www.apache.org (on) or 204.62.129.132 (off).
133# The default is off because it'd be overall better for the net if people
134# had to knowingly turn this feature on, since enabling it means that
135# each client request will result in AT LEAST one lookup request to the
136# nameserver.
137#
138HostnameLookups Off
139
140# ErrorLog: The location of the error log file.
141# If you do not specify an ErrorLog directive within a <VirtualHost>
142# container, error messages relating to that virtual host will be
143# logged here. If you *do* define an error logfile for a <VirtualHost>
144# container, that host's errors will be logged there and not here.
145#
146ErrorLog ${APACHE_LOG_DIR}/error.log
147
148#
149# LogLevel: Control the severity of messages logged to the error_log.
150# Available values: trace8, ..., trace1, debug, info, notice, warn,
151# error, crit, alert, emerg.
152# It is also possible to configure the log level for particular modules, e.g.
153# "LogLevel info ssl:warn"
154#
155LogLevel warn
156
157# Include module configuration:
158IncludeOptional mods-enabled/*.load
159IncludeOptional mods-enabled/*.conf
160
161# Include list of ports to listen on
162Include ports.conf
163
164
165# Sets the default security model of the Apache2 HTTPD server. It does
166# not allow access to the root filesystem outside of /usr/share and /var/www.
167# The former is used by web applications packaged in Debian,
168# the latter may be used for local directories served by the web server. If
169# your system is serving content from a sub-directory in /srv you must allow
170# access here, or in any related virtual host.
171<Directory />
172 Options FollowSymLinks
173 AllowOverride None
174 Require all denied
175</Directory>
176
177<Directory /usr/share>
178 AllowOverride None
179 Require all granted
180</Directory>
181
182<Directory /var/www/>
183 Options Indexes FollowSymLinks
184 AllowOverride None
185 Require all granted
186</Directory>
187
188#<Directory /srv/>
189# Options Indexes FollowSymLinks
190# AllowOverride None
191# Require all granted
192#</Directory>
193
194
195
196
197# AccessFileName: The name of the file to look for in each directory
198# for additional configuration directives. See also the AllowOverride
199# directive.
200#
201AccessFileName .htaccess
202
203#
204# The following lines prevent .htaccess and .htpasswd files from being
205# viewed by Web clients.
206#
207<FilesMatch "^\.ht">
208 Require all denied
209</FilesMatch>
210
211
212#
213# The following directives define some format nicknames for use with
214# a CustomLog directive.
215#
216# These deviate from the Common Log Format definitions in that they use %O
217# (the actual bytes sent including headers) instead of %b (the size of the
218# requested file), because the latter makes it impossible to detect partial
219# requests.
220#
221# Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
222# Use mod_remoteip instead.
223#
224LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
225LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
226LogFormat "%h %l %u %t \"%r\" %>s %O" common
227LogFormat "%{Referer}i -> %U" referer
228LogFormat "%{User-agent}i" agent
229
230# Include of directories ignores editors' and dpkg's backup files,
231# see README.Debian for details.
232
233# Include generic snippets of statements
234IncludeOptional conf-enabled/*.conf
235
236# Include the virtual host configurations:
237IncludeOptional sites-enabled/*.conf
238
239# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
240ServerName localhost