# This is the main Apache server configuration file. It contains the1# configuration directives that give the server its instructions.2# See http://httpd.apache.org/docs/2.4/ for detailed information about3# the directives and /usr/share/doc/apache2/README.Debian about Debian specific4# hints.5#6#7# Summary of how the Apache 2 configuration works in Debian:8# The Apache 2 web server configuration in Debian is quite different to9# upstream's suggested way to configure the web server. This is because Debian's10# default Apache2 installation attempts to make adding and removing modules,11# virtual hosts, and extra configuration directives as flexible as possible, in12# order to make automating the changes and administering the server as easy as13# possible.1415# It is split into several files forming the configuration hierarchy outlined16# below, all located in the /etc/apache2/ directory:17#18# /etc/apache2/19# |-- apache2.conf20# | `-- ports.conf21# |-- mods-enabled22# | |-- *.load23# | `-- *.conf24# |-- conf-enabled25# | `-- *.conf26# `-- sites-enabled27# `-- *.conf28#29#30# * apache2.conf is the main configuration file (this file). It puts the pieces31# together by including all remaining configuration files when starting up the32# web server.33#34# * ports.conf is always included from the main configuration file. It is35# supposed to determine listening ports for incoming connections which can be36# customized anytime.37#38# * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/39# directories contain particular configuration snippets which manage modules,40# global configuration fragments, or virtual host configurations,41# respectively.42#43# They are activated by symlinking available configuration files from their44# respective *-available/ counterparts. These should be managed by using our45# helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See46# their respective man pages for detailed information.47#48# * The binary is called apache2. Due to the use of environment variables, in49# the default configuration, apache2 needs to be started/stopped with50# /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not51# work with the default configuration.525354# Global configuration55#5657#58# ServerRoot: The top of the directory tree under which the server's59# configuration, error, and log files are kept.60#61# NOTE! If you intend to place this on an NFS (or otherwise network)62# mounted filesystem then please read the Mutex documentation (available63# at <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);64# you will save yourself a lot of trouble.65#66# Do NOT add a slash at the end of the directory path.67#68#ServerRoot "/etc/apache2"6970#71# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.72#73#Mutex file:${APACHE_LOCK_DIR} default7475#76# The directory where shm and other runtime files will be stored.77#7879DefaultRuntimeDir ${APACHE_RUN_DIR}8081#82# PidFile: The file in which the server should record its process83# identification number when it starts.84# This needs to be set in /etc/apache2/envvars85#86PidFile ${APACHE_PID_FILE}8788#89# Timeout: The number of seconds before receives and sends time out.90#91Timeout 3009293#94# KeepAlive: Whether or not to allow persistent connections (more than95# one request per connection). Set to "Off" to deactivate.96#97KeepAlive On9899#100# MaxKeepAliveRequests: The maximum number of requests to allow101# during a persistent connection. Set to 0 to allow an unlimited amount.102# We recommend you leave this number high, for maximum performance.103#104MaxKeepAliveRequests 100105106#107# KeepAliveTimeout: Number of seconds to wait for the next request from the108# same client on the same connection.109#110KeepAliveTimeout 5111112113# These need to be set in /etc/apache2/envvars114User ${APACHE_RUN_USER}115Group ${APACHE_RUN_GROUP}116117#118# HostnameLookups: Log the names of clients or just their IP addresses119# e.g., www.apache.org (on) or 204.62.129.132 (off).120# The default is off because it'd be overall better for the net if people121# had to knowingly turn this feature on, since enabling it means that122# each client request will result in AT LEAST one lookup request to the123# nameserver.124#125HostnameLookups Off126127# ErrorLog: The location of the error log file.128# If you do not specify an ErrorLog directive within a <VirtualHost>129# container, error messages relating to that virtual host will be130# logged here. If you *do* define an error logfile for a <VirtualHost>131# container, that host's errors will be logged there and not here.132#133ErrorLog ${APACHE_LOG_DIR}/error.log134135#136# LogLevel: Control the severity of messages logged to the error_log.137# Available values: trace8, ..., trace1, debug, info, notice, warn,138# error, crit, alert, emerg.139# It is also possible to configure the log level for particular modules, e.g.140# "LogLevel info ssl:warn"141#142LogLevel warn143144# Include module configuration:145IncludeOptional mods-enabled/*.load146IncludeOptional mods-enabled/*.conf147148# Include list of ports to listen on149Include ports.conf150151152# Sets the default security model of the Apache2 HTTPD server. It does153# not allow access to the root filesystem outside of /usr/share and /var/www.154# The former is used by web applications packaged in Debian,155# the latter may be used for local directories served by the web server. If156# your system is serving content from a sub-directory in /srv you must allow157# access here, or in any related virtual host.158<Directory />159Options FollowSymLinks160AllowOverride None161Require all denied162</Directory>163164<Directory /usr/share>165AllowOverride None166Require all granted167</Directory>168169<Directory /var/www/>170Options FollowSymLinks171AllowOverride None172Require all granted173</Directory>174175#<Directory /srv/>176# Options Indexes FollowSymLinks177# AllowOverride None178# Require all granted179#</Directory>180181182183184# AccessFileName: The name of the file to look for in each directory185# for additional configuration directives. See also the AllowOverride186# directive.187#188AccessFileName .htaccess189190#191# The following lines prevent .htaccess and .htpasswd files from being192# viewed by Web clients.193#194<FilesMatch "^\.ht">195Require all denied196</FilesMatch>197198199#200# The following directives define some format nicknames for use with201# a CustomLog directive.202#203# These deviate from the Common Log Format definitions in that they use %O204# (the actual bytes sent including headers) instead of %b (the size of the205# requested file), because the latter makes it impossible to detect partial206# requests.207#208# Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.209# Use mod_remoteip instead.210#211LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined212LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined213LogFormat "%h %l %u %t \"%r\" %>s %O" common214LogFormat "%{Referer}i -> %U" referer215LogFormat "%{User-agent}i" agent216217# Include of directories ignores editors' and dpkg's backup files,218# see README.Debian for details.219220# Include generic snippets of statements221IncludeOptional conf-enabled/*.conf222223# Include the virtual host configurations:224IncludeOptional sites-enabled/*.conf225226# vim: syntax=apache ts=4 sw=4 sts=4 sr noet227228229