Saltstack Official Apache Formula
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

428 rindas
15KB

  1. #
  2. # This is the main Apache HTTP server configuration file. It contains the
  3. # configuration directives that give the server its instructions.
  4. # See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
  5. # In particular, see
  6. # <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
  7. # for a discussion of each configuration directive.
  8. #
  9. # Do NOT simply read the instructions in here without understanding
  10. # what they do. They're here only as hints or reminders. If you are unsure
  11. # consult the online docs. You have been warned.
  12. #
  13. # Configuration and logfile names: If the filenames you specify for many
  14. # of the server's control files begin with "/" (or "drive:/" for Win32), the
  15. # server will use that explicit path. If the filenames do *not* begin
  16. # with "/", the value of ServerRoot is prepended -- so 'log/access_log'
  17. # with ServerRoot set to '/www' will be interpreted by the
  18. # server as '/www/log/access_log', where as '/log/access_log' will be
  19. # interpreted as '/log/access_log'.
  20. #
  21. # ServerRoot: The top of the directory tree under which the server's
  22. # configuration, error, and log files are kept.
  23. #
  24. # Do not add a slash at the end of the directory path. If you point
  25. # ServerRoot at a non-local disk, be sure to specify a local disk on the
  26. # Mutex directive, if file-based mutexes are used. If you wish to share the
  27. # same ServerRoot for multiple httpd daemons, you will need to change at
  28. # least PidFile.
  29. #
  30. ServerRoot "/etc/httpd"
  31. #
  32. # Listen: Allows you to bind Apache to specific IP addresses and/or
  33. # ports, instead of the default. See also the <VirtualHost>
  34. # directive.
  35. #
  36. # Change this to Listen on specific IP addresses as shown below to
  37. # prevent Apache from glomming onto all bound IP addresses.
  38. #
  39. #Listen 12.34.56.78:80
  40. Listen 80
  41. #
  42. # Dynamic Shared Object (DSO) Support
  43. #
  44. # To be able to use the functionality of a module which was built as a DSO you
  45. # have to place corresponding `LoadModule' lines at this location so the
  46. # directives contained in it are actually available _before_ they are used.
  47. # Statically compiled modules (those listed by `httpd -l') do not need
  48. # to be loaded here.
  49. #
  50. # Example:
  51. # LoadModule foo_module modules/mod_foo.so
  52. #
  53. LoadModule auth_basic_module modules/mod_auth_basic.so
  54. LoadModule auth_digest_module modules/mod_auth_digest.so
  55. LoadModule authn_file_module modules/mod_authn_file.so
  56. LoadModule authn_alias_module modules/mod_authn_alias.so
  57. LoadModule authn_anon_module modules/mod_authn_anon.so
  58. LoadModule authn_dbm_module modules/mod_authn_dbm.so
  59. LoadModule authn_default_module modules/mod_authn_default.so
  60. LoadModule authz_host_module modules/mod_authz_host.so
  61. LoadModule authz_user_module modules/mod_authz_user.so
  62. LoadModule authz_owner_module modules/mod_authz_owner.so
  63. LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
  64. LoadModule authz_dbm_module modules/mod_authz_dbm.so
  65. LoadModule authz_default_module modules/mod_authz_default.so
  66. LoadModule ldap_module modules/mod_ldap.so
  67. LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
  68. LoadModule include_module modules/mod_include.so
  69. LoadModule log_config_module modules/mod_log_config.so
  70. LoadModule logio_module modules/mod_logio.so
  71. LoadModule env_module modules/mod_env.so
  72. LoadModule ext_filter_module modules/mod_ext_filter.so
  73. LoadModule mime_magic_module modules/mod_mime_magic.so
  74. LoadModule expires_module modules/mod_expires.so
  75. LoadModule deflate_module modules/mod_deflate.so
  76. LoadModule headers_module modules/mod_headers.so
  77. LoadModule usertrack_module modules/mod_usertrack.so
  78. LoadModule setenvif_module modules/mod_setenvif.so
  79. LoadModule mime_module modules/mod_mime.so
  80. LoadModule dav_module modules/mod_dav.so
  81. LoadModule status_module modules/mod_status.so
  82. LoadModule autoindex_module modules/mod_autoindex.so
  83. LoadModule info_module modules/mod_info.so
  84. LoadModule dav_fs_module modules/mod_dav_fs.so
  85. LoadModule vhost_alias_module modules/mod_vhost_alias.so
  86. LoadModule negotiation_module modules/mod_negotiation.so
  87. LoadModule dir_module modules/mod_dir.so
  88. LoadModule actions_module modules/mod_actions.so
  89. LoadModule speling_module modules/mod_speling.so
  90. LoadModule userdir_module modules/mod_userdir.so
  91. LoadModule alias_module modules/mod_alias.so
  92. LoadModule substitute_module modules/mod_substitute.so
  93. LoadModule rewrite_module modules/mod_rewrite.so
  94. LoadModule proxy_module modules/mod_proxy.so
  95. LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
  96. LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
  97. LoadModule proxy_http_module modules/mod_proxy_http.so
  98. LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
  99. LoadModule proxy_connect_module modules/mod_proxy_connect.so
  100. LoadModule cache_module modules/mod_cache.so
  101. LoadModule suexec_module modules/mod_suexec.so
  102. LoadModule disk_cache_module modules/mod_disk_cache.so
  103. LoadModule cgi_module modules/mod_cgi.so
  104. LoadModule version_module modules/mod_version.so
  105. #
  106. # The following modules are not loaded by default:
  107. #
  108. #LoadModule asis_module modules/mod_asis.so
  109. #LoadModule authn_dbd_module modules/mod_authn_dbd.so
  110. #LoadModule cern_meta_module modules/mod_cern_meta.so
  111. #LoadModule cgid_module modules/mod_cgid.so
  112. #LoadModule dbd_module modules/mod_dbd.so
  113. #LoadModule dumpio_module modules/mod_dumpio.so
  114. #LoadModule filter_module modules/mod_filter.so
  115. #LoadModule ident_module modules/mod_ident.so
  116. #LoadModule log_forensic_module modules/mod_log_forensic.so
  117. #LoadModule unique_id_module modules/mod_unique_id.so
  118. #LoadModule file_cache_module modules/mod_file_cache.so
  119. #
  120. # If you wish httpd to run as a different user or group, you must run
  121. # httpd as root initially and it will switch.
  122. #
  123. # User/Group: The name (or #number) of the user/group to run httpd as.
  124. # It is usually good practice to create a dedicated user and group for
  125. # running httpd, as with most system services.
  126. #
  127. User apache
  128. Group apache
  129. # 'Main' server configuration
  130. #
  131. # The directives in this section set up the values used by the 'main'
  132. # server, which responds to any requests that aren't handled by a
  133. # <VirtualHost> definition. These values also provide defaults for
  134. # any <VirtualHost> containers you may define later in the file.
  135. #
  136. # All of these directives may appear inside <VirtualHost> containers,
  137. # in which case these default settings will be overridden for the
  138. # virtual host being defined.
  139. #
  140. #
  141. # ServerAdmin: Your address, where problems with the server should be
  142. # e-mailed. This address appears on some server-generated pages, such
  143. # as error documents. e.g. admin@your-domain.com
  144. #
  145. ServerAdmin root@localhost
  146. #
  147. # ServerName gives the name and port that the server uses to identify itself.
  148. # This can often be determined automatically, but we recommend you specify
  149. # it explicitly to prevent problems during startup.
  150. #
  151. # If your host doesn't have a registered DNS name, enter its IP address here.
  152. #
  153. #ServerName www.example.com:80
  154. #
  155. # Deny access to the entirety of your server's filesystem. You must
  156. # explicitly permit access to web content directories in other
  157. # <Directory> blocks below.
  158. #
  159. <Directory />
  160. AllowOverride none
  161. Require all denied
  162. </Directory>
  163. #
  164. # Note that from this point forward you must specifically allow
  165. # particular features to be enabled - so if something's not working as
  166. # you might expect, make sure that you have specifically enabled it
  167. # below.
  168. #
  169. #
  170. # DocumentRoot: The directory out of which you will serve your
  171. # documents. By default, all requests are taken from this directory, but
  172. # symbolic links and aliases may be used to point to other locations.
  173. #
  174. DocumentRoot "/var/www/html"
  175. #
  176. # Relax access to content within /var/www.
  177. #
  178. <Directory "/var/www">
  179. AllowOverride None
  180. # Allow open access:
  181. Require all granted
  182. </Directory>
  183. # Further relax access to the default document root:
  184. <Directory "/var/www/html">
  185. #
  186. # Possible values for the Options directive are "None", "All",
  187. # or any combination of:
  188. # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
  189. #
  190. # Note that "MultiViews" must be named *explicitly* --- "Options All"
  191. # doesn't give it to you.
  192. #
  193. # The Options directive is both complicated and important. Please see
  194. # http://httpd.apache.org/docs/2.4/mod/core.html#options
  195. # for more information.
  196. #
  197. Options Indexes FollowSymLinks
  198. #
  199. # AllowOverride controls what directives may be placed in .htaccess files.
  200. # It can be "All", "None", or any combination of the keywords:
  201. # Options FileInfo AuthConfig Limit
  202. #
  203. AllowOverride None
  204. #
  205. # Controls who can get stuff from this server.
  206. #
  207. Require all granted
  208. </Directory>
  209. #
  210. # DirectoryIndex: sets the file that Apache will serve if a directory
  211. # is requested.
  212. #
  213. <IfModule dir_module>
  214. DirectoryIndex index.html
  215. </IfModule>
  216. #
  217. # The following lines prevent .htaccess and .htpasswd files from being
  218. # viewed by Web clients.
  219. #
  220. <Files ".ht*">
  221. Require all denied
  222. </Files>
  223. #
  224. # ErrorLog: The location of the error log file.
  225. # If you do not specify an ErrorLog directive within a <VirtualHost>
  226. # container, error messages relating to that virtual host will be
  227. # logged here. If you *do* define an error logfile for a <VirtualHost>
  228. # container, that host's errors will be logged there and not here.
  229. #
  230. ErrorLog "logs/error_log"
  231. #
  232. # LogLevel: Control the number of messages logged to the error_log.
  233. # Possible values include: debug, info, notice, warn, error, crit,
  234. # alert, emerg.
  235. #
  236. LogLevel warn
  237. <IfModule log_config_module>
  238. #
  239. # The following directives define some format nicknames for use with
  240. # a CustomLog directive (see below).
  241. #
  242. LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
  243. LogFormat "%h %l %u %t \"%r\" %>s %b" common
  244. {%- for log_format in salt['pillar.get']('apache:log_formats', []) %}
  245. LogFormat {{ log_format }}
  246. {%- endfor %}
  247. <IfModule logio_module>
  248. # You need to enable mod_logio.c to use %I and %O
  249. LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
  250. </IfModule>
  251. #
  252. # The location and format of the access logfile (Common Logfile Format).
  253. # If you do not define any access logfiles within a <VirtualHost>
  254. # container, they will be logged here. Contrariwise, if you *do*
  255. # define per-<VirtualHost> access logfiles, transactions will be
  256. # logged therein and *not* in this file.
  257. #
  258. #CustomLog "logs/access_log" common
  259. #
  260. # If you prefer a logfile with access, agent, and referer information
  261. # (Combined Logfile Format) you can use the following directive.
  262. #
  263. CustomLog "logs/access_log" combined
  264. </IfModule>
  265. <IfModule alias_module>
  266. #
  267. # Redirect: Allows you to tell clients about documents that used to
  268. # exist in your server's namespace, but do not anymore. The client
  269. # will make a new request for the document at its new location.
  270. # Example:
  271. # Redirect permanent /foo http://www.example.com/bar
  272. #
  273. # Alias: Maps web paths into filesystem paths and is used to
  274. # access content that does not live under the DocumentRoot.
  275. # Example:
  276. # Alias /webpath /full/filesystem/path
  277. #
  278. # If you include a trailing / on /webpath then the server will
  279. # require it to be present in the URL. You will also likely
  280. # need to provide a <Directory> section to allow access to
  281. # the filesystem path.
  282. #
  283. # ScriptAlias: This controls which directories contain server scripts.
  284. # ScriptAliases are essentially the same as Aliases, except that
  285. # documents in the target directory are treated as applications and
  286. # run by the server when requested rather than as documents sent to the
  287. # client. The same rules about trailing "/" apply to ScriptAlias
  288. # directives as to Alias.
  289. #
  290. ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
  291. </IfModule>
  292. #
  293. # "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
  294. # CGI directory exists, if you have that configured.
  295. #
  296. <Directory "/var/www/cgi-bin">
  297. AllowOverride None
  298. Options None
  299. Require all granted
  300. </Directory>
  301. <IfModule mime_module>
  302. #
  303. # TypesConfig points to the file containing the list of mappings from
  304. # filename extension to MIME-type.
  305. #
  306. TypesConfig /etc/mime.types
  307. #
  308. # AddType allows you to add to or override the MIME configuration
  309. # file specified in TypesConfig for specific file types.
  310. #
  311. #AddType application/x-gzip .tgz
  312. #
  313. # AddEncoding allows you to have certain browsers uncompress
  314. # information on the fly. Note: Not all browsers support this.
  315. #
  316. #AddEncoding x-compress .Z
  317. #AddEncoding x-gzip .gz .tgz
  318. #
  319. # If the AddEncoding directives above are commented-out, then you
  320. # probably should define those extensions to indicate media types:
  321. #
  322. AddType application/x-compress .Z
  323. AddType application/x-gzip .gz .tgz
  324. #
  325. # AddHandler allows you to map certain file extensions to "handlers":
  326. # actions unrelated to filetype. These can be either built into the server
  327. # or added with the Action directive (see below)
  328. #
  329. # To use CGI scripts outside of ScriptAliased directories:
  330. # (You will also need to add "ExecCGI" to the "Options" directive.)
  331. #
  332. #AddHandler cgi-script .cgi
  333. # For type maps (negotiated resources):
  334. #AddHandler type-map var
  335. #
  336. # Filters allow you to process content before it is sent to the client.
  337. #
  338. # To parse .shtml files for server-side includes (SSI):
  339. # (You will also need to add "Includes" to the "Options" directive.)
  340. #
  341. AddType text/html .shtml
  342. AddOutputFilter INCLUDES .shtml
  343. </IfModule>
  344. #
  345. # Specify a default charset for all content served; this enables
  346. # interpretation of all content as UTF-8 by default. To use the
  347. # default browser choice (ISO-8859-1), or to allow the META tags
  348. # in HTML content to override this choice, comment out this
  349. # directive:
  350. #
  351. AddDefaultCharset UTF-8
  352. <IfModule mime_magic_module>
  353. #
  354. # The mod_mime_magic module allows the server to use various hints from the
  355. # contents of the file itself to determine its type. The MIMEMagicFile
  356. # directive tells the module where the hint definitions are located.
  357. #
  358. MIMEMagicFile conf/magic
  359. </IfModule>
  360. #
  361. # Customizable error responses come in three flavors:
  362. # 1) plain text 2) local redirects 3) external redirects
  363. #
  364. # Some examples:
  365. #ErrorDocument 500 "The server made a boo boo."
  366. #ErrorDocument 404 /missing.html
  367. #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
  368. #ErrorDocument 402 http://www.example.com/subscription_info.html
  369. #
  370. #
  371. # EnableMMAP and EnableSendfile: On systems that support it,
  372. # memory-mapping or the sendfile syscall may be used to deliver
  373. # files. This usually improves server performance, but must
  374. # be turned off when serving from networked-mounted
  375. # filesystems or if support for these functions is otherwise
  376. # broken on your system.
  377. # Defaults if commented: EnableMMAP On, EnableSendfile Off
  378. #
  379. #EnableMMAP off
  380. EnableSendfile on
  381. {%- for directive, dvalue in salt['pillar.get']('apache:global', {}).items() %}
  382. {{ directive }} {{ dvalue }}
  383. {%- endfor %}
  384. # Supplemental configuration
  385. #
  386. # Load config files in the "/etc/httpd/conf.d" directory, if any.
  387. Include conf.d/*.conf
  388. Include vhosts.d/*.conf