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