Saltstack Official Apache Formula
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

230 lines
7.3KB

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