Saltstack Official Apache Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

239 lines
9.2KB

  1. #
  2. # /etc/apache2/httpd.conf
  3. #
  4. # This is the main Apache server configuration file. It contains the
  5. # configuration directives that give the server its instructions.
  6. # See <URL:http://httpd.apache.org/docs/2.4/> for detailed information about
  7. # the directives.
  8. # Based upon the default apache configuration file that ships with apache,
  9. # which is based upon the NCSA server configuration files originally by Rob
  10. # McCool. This file was knocked together by Peter Poeml <poeml+apache@suse.de>.
  11. # If possible, avoid changes to this file. It does mainly contain Include
  12. # statements and global settings that can/should be overridden in the
  13. # configuration of your virtual hosts.
  14. # Quickstart guide:
  15. # http://en.opensuse.org/SDB:Apache_installation
  16. # Overview of include files, chronologically:
  17. #
  18. # httpd.conf
  19. # |
  20. # |-- uid.conf . . . . . . . . . . . . . . UserID/GroupID to run under
  21. # |-- server-tuning.conf . . . . . . . . . sizing of the server (how many processes to start, ...)
  22. # |-- loadmodule.conf . . . . . . . . . . . [*] load these modules
  23. # |-- listen.conf . . . . . . . . . . . . . IP adresses / ports to listen on
  24. # |-- mod_log_config.conf . . . . . . . . . define logging formats
  25. # |-- global.conf . . . . . . . . . . . . . [*] server-wide general settings
  26. # |-- mod_status.conf . . . . . . . . . . . restrict access to mod_status (server monitoring)
  27. # |-- mod_info.conf . . . . . . . . . . . . restrict access to mod_info
  28. # |-- mod_reqtimeout.conf . . . . . . . . . set timeout and minimum data rate for receiving requests
  29. # |-- mod_cgid-timeout.conf . . . . . . . . set CGIDScriptTimeout if mod_cgid is loaded/active
  30. # |-- mod_usertrack.conf . . . . . . . . . defaults for cookie-based user tracking
  31. # |-- mod_autoindex-defaults.conf . . . . . defaults for displaying of server-generated directory listings
  32. # |-- mod_mime-defaults.conf . . . . . . . defaults for mod_mime configuration
  33. # |-- errors.conf . . . . . . . . . . . . . customize error responses
  34. # |-- ssl-global.conf . . . . . . . . . . . SSL conf that applies to default server _and all_ virtual hosts
  35. # |-- protocols.conf . . . . . . . . . . . Protocol settings that applies to default server _and all_ virtual hosts
  36. # |
  37. # |-- default-server.conf . . . . . . . . . set up the default server that replies to non-virtual-host requests
  38. # | |--mod_userdir.conf . . . . . . . . enable UserDir (if mod_userdir is loaded)
  39. # | `--conf.d/apache2-manual?conf . . . add the docs ('?' = if installed)
  40. # |
  41. # `-- vhosts.d/ . . . . . . . . . . . . . . for each virtual host, place one file here
  42. # `-- *.conf . . . . . . . . . . . . . (*.conf is automatically included)
  43. #
  44. #
  45. # Files marked [*] are NOT read when server is started via systemd service. When server
  46. # is started via service, defaults from /etc/sysconfig/apache2 are taken into account.
  47. #
  48. # Filesystem layout:
  49. #
  50. # /etc/apache2/
  51. # |-- charset.conv . . . . . . . . . . . . for mod_auth_ldap
  52. # |-- conf.d/
  53. # | |-- apache2-manual.conf . . . . . . . conf that comes with apache2-doc
  54. # | |-- mod_php4.conf . . . . . . . . . . (example) conf that comes with apache2-mod_php4
  55. # | `-- ... . . . . . . . . . . . . . . . other configuration added by packages
  56. # |-- default-server.conf
  57. # |-- errors.conf
  58. # |-- httpd.conf . . . . . . . . . . . . . top level configuration file
  59. # |-- listen.conf
  60. # |-- magic
  61. # |-- mime.types -> ../mime.types
  62. # |-- mod_autoindex-defaults.conf
  63. # |-- mod_info.conf
  64. # |-- mod_log_config.conf
  65. # |-- mod_mime-defaults.conf
  66. # |-- mod_perl-startup.pl
  67. # |-- mod_status.conf
  68. # |-- mod_userdir.conf
  69. # |-- mod_usertrack.conf
  70. # |-- server-tuning.conf
  71. # |-- ssl-global.conf
  72. # |-- protocols.conf
  73. # |-- ssl.crl/ . . . . . . . . . . . . . . PEM-encoded X.509 Certificate Revocation Lists (CRL)
  74. # |-- ssl.crt/ . . . . . . . . . . . . . . PEM-encoded X.509 Certificates
  75. # |-- ssl.csr/ . . . . . . . . . . . . . . PEM-encoded X.509 Certificate Signing Requests
  76. # |-- ssl.key/ . . . . . . . . . . . . . . PEM-encoded RSA Private Keys
  77. # |-- ssl.prm/ . . . . . . . . . . . . . . public DSA Parameter Files
  78. # |-- global.conf
  79. # |-- loadmodule.conf
  80. # |-- uid.conf
  81. # `-- vhosts.d/ . . . . . . . . . . . . . . put your virtual host configuration (*.conf) here
  82. # |-- vhost-ssl.template
  83. # `-- vhost.template
  84. ### Global Environment ######################################################
  85. #
  86. # The directives in this section affect the overall operation of Apache,
  87. # such as the number of concurrent requests.
  88. # run under this user/group id
  89. Include /etc/apache2/uid.conf
  90. # - how many server processes to start (server pool regulation)
  91. # - usage of KeepAlive
  92. Include /etc/apache2/server-tuning.conf
  93. # ErrorLog: The location of the error log file.
  94. # If you do not specify an ErrorLog directive within a <VirtualHost>
  95. # container, error messages relating to that virtual host will be
  96. # logged here. If you *do* define an error logfile for a <VirtualHost>
  97. # container, that host's errors will be logged there and not here.
  98. ErrorLog /var/log/apache2/error_log
  99. # generated from default value of APACHE_MODULES in /etc/sysconfig/apache2
  100. <IfDefine !SYSCONFIG>
  101. Include /etc/apache2/loadmodule.conf
  102. </IfDefine>
  103. # IP addresses / ports to listen on
  104. Include /etc/apache2/listen.conf
  105. # predefined logging formats
  106. Include /etc/apache2/mod_log_config.conf
  107. # generated from default values of global settings in /etc/sysconfig/apache2
  108. <IfDefine !SYSCONFIG>
  109. Include /etc/apache2/global.conf
  110. </IfDefine>
  111. # optional mod_status, mod_info
  112. Include /etc/apache2/mod_status.conf
  113. Include /etc/apache2/mod_info.conf
  114. # mod_reqtimeout protects the server from the so-called "slowloris"
  115. # attack: The server is not swamped with requests in fast succession,
  116. # but with slowly transmitted request headers and body, thereby filling up
  117. # the request slots until the server runs out of them.
  118. # mod_reqtimeout is lightweight and should deliver good results
  119. # with the configured default values. You shouldn't notice it at all.
  120. Include /etc/apache2/mod_reqtimeout.conf
  121. # Fix for CVE-2014-0231 introduces new configuration parameter
  122. # CGIDScriptTimeout. This directive and its effect prevent request
  123. # workers to be eaten until starvation if cgi programs do not send
  124. # output back to the server within the timout set by CGIDScriptTimeout.
  125. Include /etc/apache2/mod_cgid-timeout.conf
  126. # optional cookie-based user tracking
  127. # read the documentation before using it!!
  128. Include /etc/apache2/mod_usertrack.conf
  129. # configuration of server-generated directory listings
  130. Include /etc/apache2/mod_autoindex-defaults.conf
  131. # associate MIME types with filename extensions
  132. TypesConfig /etc/apache2/mime.types
  133. Include /etc/apache2/mod_mime-defaults.conf
  134. # set up (customizable) error responses
  135. Include /etc/apache2/errors.conf
  136. # global (server-wide) SSL configuration, that is not specific to
  137. # any virtual host
  138. Include /etc/apache2/ssl-global.conf
  139. {% if salt['pillar.get']('apache:mod_ssl:manage_tls_defaults', False) -%}
  140. Include /etc/apache24/conf.d/tls-defaults.conf
  141. {%- %}
  142. # global (server-wide) protocol configuration, that is not specific
  143. # to any virtual host
  144. Include /etc/apache2/protocols.conf
  145. # forbid access to the entire filesystem by default
  146. <Directory />
  147. Options None
  148. AllowOverride None
  149. <IfModule !mod_access_compat.c>
  150. Require all denied
  151. </IfModule>
  152. <IfModule mod_access_compat.c>
  153. Order deny,allow
  154. Deny from all
  155. </IfModule>
  156. </Directory>
  157. # use .htaccess files for overriding,
  158. AccessFileName .htaccess
  159. # and never show them
  160. <Files ~ "^\.ht">
  161. <IfModule !mod_access_compat.c>
  162. Require all denied
  163. </IfModule>
  164. <IfModule mod_access_compat.c>
  165. Order allow,deny
  166. Deny from all
  167. </IfModule>
  168. </Files>
  169. # List of resources to look for when the client requests a directory
  170. DirectoryIndex index.html index.html.var
  171. ### 'Main' server configuration #############################################
  172. #
  173. # The directives in this section set up the values used by the 'main'
  174. # server, which responds to any requests that aren't handled by a
  175. # <VirtualHost> definition. These values also provide defaults for
  176. # any <VirtualHost> containers you may define later in the file.
  177. #
  178. # All of these directives may appear inside <VirtualHost> containers,
  179. # in which case these default settings will be overridden for the
  180. # virtual host being defined.
  181. #
  182. Include /etc/apache2/default-server.conf
  183. ### Virtual server configuration ############################################
  184. #
  185. # VirtualHost: If you want to maintain multiple domains/hostnames on your
  186. # machine you can setup VirtualHost containers for them. Most configurations
  187. # use only name-based virtual hosts so the server doesn't need to worry about
  188. # IP addresses. This is indicated by the asterisks in the directives below.
  189. #
  190. # Please see the documentation at
  191. # <URL:http://httpd.apache.org/docs/2.4/vhosts/>
  192. # for further details before you try to setup virtual hosts.
  193. #
  194. # You may use the command line option '-S' to verify your virtual host
  195. # configuration.
  196. #
  197. IncludeOptional /etc/apache2/vhosts.d/*.conf
  198. # Note: instead of adding your own configuration here, consider
  199. # adding it in your own file (/etc/apache2/httpd.conf.local)
  200. # putting its name into APACHE_CONF_INCLUDE_FILES in
  201. # /etc/sysconfig/apache2 -- this will make system updates
  202. # easier :)