Guest User

Apache 2.4 global config

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