Saltstack Official Apache Formula
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

245 lines
8.4KB

  1. #
  2. # This file is managed by Salt! Do not edit by hand!
  3. #
  4. # Based upon the NCSA server configuration files originally by Rob McCool.
  5. #
  6. # This is the main Apache server configuration file. It contains the
  7. # configuration directives that give the server its instructions.
  8. # See http://httpd.apache.org/docs/2.2/ for detailed information about
  9. # the directives.
  10. #
  11. # Do NOT simply read the instructions in here without understanding
  12. # what they do. They're here only as hints or reminders. If you are unsure
  13. # consult the online docs. You have been warned.
  14. #
  15. # The configuration directives are grouped into three basic sections:
  16. # 1. Directives that control the operation of the Apache server process as a
  17. # whole (the 'global environment').
  18. # 2. Directives that define the parameters of the 'main' or 'default' server,
  19. # which responds to requests that aren't handled by a virtual host.
  20. # These directives also provide default values for the settings
  21. # of all virtual hosts.
  22. # 3. Settings for virtual hosts, which allow Web requests to be sent to
  23. # different IP addresses or hostnames and have them handled by the
  24. # same Apache server process.
  25. #
  26. # Configuration and logfile names: If the filenames you specify for many
  27. # of the server's control files begin with "/" (or "drive:/" for Win32), the
  28. # server will use that explicit path. If the filenames do *not* begin
  29. # with "/", the value of ServerRoot is prepended -- so "foo.log"
  30. # with ServerRoot set to "/etc/apache2" will be interpreted by the
  31. # server as "/etc/apache2/foo.log".
  32. #
  33. ### Section 1: Global Environment
  34. #
  35. # The directives in this section affect the overall operation of Apache,
  36. # such as the number of concurrent requests it can handle or where it
  37. # can find its configuration files.
  38. #
  39. #
  40. # ServerRoot: The top of the directory tree under which the server's
  41. # configuration, error, and log files are kept.
  42. #
  43. # NOTE! If you intend to place this on an NFS (or otherwise network)
  44. # mounted filesystem then please read the LockFile documentation (available
  45. # at <URL:http://httpd.apache.org/docs/2.2/mod/mpm_common.html#lockfile>);
  46. # you will save yourself a lot of trouble.
  47. #
  48. # Do NOT add a slash at the end of the directory path.
  49. #
  50. #ServerRoot "/etc/apache2"
  51. #
  52. # The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
  53. #
  54. LockFile ${APACHE_LOCK_DIR}/accept.lock
  55. #
  56. # PidFile: The file in which the server should record its process
  57. # identification number when it starts.
  58. # This needs to be set in /etc/apache2/envvars
  59. #
  60. PidFile ${APACHE_PID_FILE}
  61. #
  62. # Timeout: The number of seconds before receives and sends time out.
  63. #
  64. Timeout 300
  65. #
  66. # KeepAlive: Whether or not to allow persistent connections (more than
  67. # one request per connection). Set to "Off" to deactivate.
  68. #
  69. KeepAlive {{ salt['pillar.get']('apache:keepalive', 'On') }}
  70. #
  71. # MaxKeepAliveRequests: The maximum number of requests to allow
  72. # during a persistent connection. Set to 0 to allow an unlimited amount.
  73. # We recommend you leave this number high, for maximum performance.
  74. #
  75. MaxKeepAliveRequests 100
  76. #
  77. # KeepAliveTimeout: Number of seconds to wait for the next request from the
  78. # same client on the same connection.
  79. #
  80. KeepAliveTimeout 5
  81. ##
  82. ## Server-Pool Size Regulation (MPM specific)
  83. ##
  84. # prefork MPM
  85. # StartServers: number of server processes to start
  86. # MinSpareServers: minimum number of server processes which are kept spare
  87. # MaxSpareServers: maximum number of server processes which are kept spare
  88. # MaxClients: maximum number of server processes allowed to start
  89. # MaxRequestsPerChild: maximum number of requests a server process serves
  90. <IfModule mpm_prefork_module>
  91. StartServers 5
  92. MinSpareServers 5
  93. MaxSpareServers 10
  94. MaxClients 150
  95. MaxRequestsPerChild 0
  96. </IfModule>
  97. # worker MPM
  98. # StartServers: initial number of server processes to start
  99. # MinSpareThreads: minimum number of worker threads which are kept spare
  100. # MaxSpareThreads: maximum number of worker threads which are kept spare
  101. # ThreadLimit: ThreadsPerChild can be changed to this maximum value during a
  102. # graceful restart. ThreadLimit can only be changed by stopping
  103. # and starting Apache.
  104. # ThreadsPerChild: constant number of worker threads in each server process
  105. # MaxClients: maximum number of simultaneous client connections
  106. # MaxRequestsPerChild: maximum number of requests a server process serves
  107. <IfModule mpm_worker_module>
  108. StartServers 2
  109. MinSpareThreads 25
  110. MaxSpareThreads 75
  111. ThreadLimit 64
  112. ThreadsPerChild 25
  113. MaxClients 150
  114. MaxRequestsPerChild 0
  115. </IfModule>
  116. # event MPM
  117. # StartServers: initial number of server processes to start
  118. # MinSpareThreads: minimum number of worker threads which are kept spare
  119. # MaxSpareThreads: maximum number of worker threads which are kept spare
  120. # ThreadsPerChild: constant number of worker threads in each server process
  121. # MaxClients: maximum number of simultaneous client connections
  122. # MaxRequestsPerChild: maximum number of requests a server process serves
  123. <IfModule mpm_event_module>
  124. StartServers 2
  125. MinSpareThreads 25
  126. MaxSpareThreads 75
  127. ThreadLimit 64
  128. ThreadsPerChild 25
  129. MaxClients 150
  130. MaxRequestsPerChild 0
  131. </IfModule>
  132. # These need to be set in /etc/apache2/envvars
  133. User ${APACHE_RUN_USER}
  134. Group ${APACHE_RUN_GROUP}
  135. #
  136. # AccessFileName: The name of the file to look for in each directory
  137. # for additional configuration directives. See also the AllowOverride
  138. # directive.
  139. #
  140. AccessFileName .htaccess
  141. #
  142. # The following lines prevent .htaccess and .htpasswd files from being
  143. # viewed by Web clients.
  144. #
  145. <Files ~ "^\.ht">
  146. Order allow,deny
  147. Deny from all
  148. Satisfy all
  149. </Files>
  150. #
  151. # DefaultType is the default MIME type the server will use for a document
  152. # if it cannot otherwise determine one, such as from filename extensions.
  153. # If your server contains mostly text or HTML documents, "text/plain" is
  154. # a good value. If most of your content is binary, such as applications
  155. # or images, you may want to use "application/octet-stream" instead to
  156. # keep browsers from trying to display binary files as though they are
  157. # text.
  158. #
  159. # It is also possible to omit any default MIME type and let the
  160. # client's browser guess an appropriate action instead. Typically the
  161. # browser will decide based on the file's extension then. In cases
  162. # where no good assumption can be made, letting the default MIME type
  163. # unset is suggested instead of forcing the browser to accept
  164. # incorrect metadata.
  165. #
  166. DefaultType None
  167. #
  168. # HostnameLookups: Log the names of clients or just their IP addresses
  169. # e.g., www.apache.org (on) or 204.62.129.132 (off).
  170. # The default is off because it'd be overall better for the net if people
  171. # had to knowingly turn this feature on, since enabling it means that
  172. # each client request will result in AT LEAST one lookup request to the
  173. # nameserver.
  174. #
  175. HostnameLookups Off
  176. # ErrorLog: The location of the error log file.
  177. # If you do not specify an ErrorLog directive within a <VirtualHost>
  178. # container, error messages relating to that virtual host will be
  179. # logged here. If you *do* define an error logfile for a <VirtualHost>
  180. # container, that host's errors will be logged there and not here.
  181. #
  182. ErrorLog ${APACHE_LOG_DIR}/error.log
  183. #
  184. # LogLevel: Control the number of messages logged to the error_log.
  185. # Possible values include: debug, info, notice, warn, error, crit,
  186. # alert, emerg.
  187. #
  188. LogLevel warn
  189. # Include module configuration:
  190. Include mods-enabled/*.load
  191. Include mods-enabled/*.conf
  192. # Include all the user configurations:
  193. Include httpd.conf
  194. # Include ports listing
  195. Include ports.conf
  196. #
  197. # The following directives define some format nicknames for use with
  198. # a CustomLog directive (see below).
  199. # If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
  200. #
  201. LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
  202. LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
  203. LogFormat "%h %l %u %t \"%r\" %>s %O" common
  204. LogFormat "%{Referer}i -> %U" referer
  205. LogFormat "%{User-agent}i" agent
  206. {%- for directive, dvalue in salt['pillar.get']('apache:global', {}).items() %}
  207. {{ directive }} {{ dvalue }}
  208. {%- endfor %}
  209. # Include of directories ignores editors' and dpkg's backup files,
  210. # see README.Debian for details.
  211. # Include generic snippets of statements
  212. Include conf.d/
  213. # Include the virtual host configurations:
  214. Include sites-enabled/