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.

358 lines
12KB

  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. Include conf.modules.d/*.conf
  54. #
  55. # If you wish httpd to run as a different user or group, you must run
  56. # httpd as root initially and it will switch.
  57. #
  58. # User/Group: The name (or #number) of the user/group to run httpd as.
  59. # It is usually good practice to create a dedicated user and group for
  60. # running httpd, as with most system services.
  61. #
  62. User apache
  63. Group apache
  64. # 'Main' server configuration
  65. #
  66. # The directives in this section set up the values used by the 'main'
  67. # server, which responds to any requests that aren't handled by a
  68. # <VirtualHost> definition. These values also provide defaults for
  69. # any <VirtualHost> containers you may define later in the file.
  70. #
  71. # All of these directives may appear inside <VirtualHost> containers,
  72. # in which case these default settings will be overridden for the
  73. # virtual host being defined.
  74. #
  75. #
  76. # ServerAdmin: Your address, where problems with the server should be
  77. # e-mailed. This address appears on some server-generated pages, such
  78. # as error documents. e.g. admin@your-domain.com
  79. #
  80. ServerAdmin root@localhost
  81. #
  82. # ServerName gives the name and port that the server uses to identify itself.
  83. # This can often be determined automatically, but we recommend you specify
  84. # it explicitly to prevent problems during startup.
  85. #
  86. # If your host doesn't have a registered DNS name, enter its IP address here.
  87. #
  88. #ServerName www.example.com:80
  89. #
  90. # Deny access to the entirety of your server's filesystem. You must
  91. # explicitly permit access to web content directories in other
  92. # <Directory> blocks below.
  93. #
  94. <Directory />
  95. AllowOverride none
  96. Require all denied
  97. </Directory>
  98. #
  99. # Note that from this point forward you must specifically allow
  100. # particular features to be enabled - so if something's not working as
  101. # you might expect, make sure that you have specifically enabled it
  102. # below.
  103. #
  104. #
  105. # DocumentRoot: The directory out of which you will serve your
  106. # documents. By default, all requests are taken from this directory, but
  107. # symbolic links and aliases may be used to point to other locations.
  108. #
  109. DocumentRoot "/var/www/html"
  110. #
  111. # Relax access to content within /var/www.
  112. #
  113. <Directory "/var/www">
  114. AllowOverride None
  115. # Allow open access:
  116. Require all granted
  117. </Directory>
  118. # Further relax access to the default document root:
  119. <Directory "/var/www/html">
  120. #
  121. # Possible values for the Options directive are "None", "All",
  122. # or any combination of:
  123. # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
  124. #
  125. # Note that "MultiViews" must be named *explicitly* --- "Options All"
  126. # doesn't give it to you.
  127. #
  128. # The Options directive is both complicated and important. Please see
  129. # http://httpd.apache.org/docs/2.4/mod/core.html#options
  130. # for more information.
  131. #
  132. Options Indexes FollowSymLinks
  133. #
  134. # AllowOverride controls what directives may be placed in .htaccess files.
  135. # It can be "All", "None", or any combination of the keywords:
  136. # Options FileInfo AuthConfig Limit
  137. #
  138. AllowOverride None
  139. #
  140. # Controls who can get stuff from this server.
  141. #
  142. Require all granted
  143. </Directory>
  144. #
  145. # DirectoryIndex: sets the file that Apache will serve if a directory
  146. # is requested.
  147. #
  148. <IfModule dir_module>
  149. DirectoryIndex index.html
  150. </IfModule>
  151. #
  152. # The following lines prevent .htaccess and .htpasswd files from being
  153. # viewed by Web clients.
  154. #
  155. <Files ".ht*">
  156. Require all denied
  157. </Files>
  158. #
  159. # ErrorLog: The location of the error log file.
  160. # If you do not specify an ErrorLog directive within a <VirtualHost>
  161. # container, error messages relating to that virtual host will be
  162. # logged here. If you *do* define an error logfile for a <VirtualHost>
  163. # container, that host's errors will be logged there and not here.
  164. #
  165. ErrorLog "logs/error_log"
  166. #
  167. # LogLevel: Control the number of messages logged to the error_log.
  168. # Possible values include: debug, info, notice, warn, error, crit,
  169. # alert, emerg.
  170. #
  171. LogLevel warn
  172. <IfModule log_config_module>
  173. #
  174. # The following directives define some format nicknames for use with
  175. # a CustomLog directive (see below).
  176. #
  177. LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
  178. LogFormat "%h %l %u %t \"%r\" %>s %b" common
  179. {%- for log_format in salt['pillar.get']('apache:log_formats', []) %}
  180. LogFormat {{ log_format }}
  181. {%- endfor %}
  182. <IfModule logio_module>
  183. # You need to enable mod_logio.c to use %I and %O
  184. LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
  185. </IfModule>
  186. #
  187. # The location and format of the access logfile (Common Logfile Format).
  188. # If you do not define any access logfiles within a <VirtualHost>
  189. # container, they will be logged here. Contrariwise, if you *do*
  190. # define per-<VirtualHost> access logfiles, transactions will be
  191. # logged therein and *not* in this file.
  192. #
  193. #CustomLog "logs/access_log" common
  194. #
  195. # If you prefer a logfile with access, agent, and referer information
  196. # (Combined Logfile Format) you can use the following directive.
  197. #
  198. CustomLog "logs/access_log" combined
  199. </IfModule>
  200. <IfModule alias_module>
  201. #
  202. # Redirect: Allows you to tell clients about documents that used to
  203. # exist in your server's namespace, but do not anymore. The client
  204. # will make a new request for the document at its new location.
  205. # Example:
  206. # Redirect permanent /foo http://www.example.com/bar
  207. #
  208. # Alias: Maps web paths into filesystem paths and is used to
  209. # access content that does not live under the DocumentRoot.
  210. # Example:
  211. # Alias /webpath /full/filesystem/path
  212. #
  213. # If you include a trailing / on /webpath then the server will
  214. # require it to be present in the URL. You will also likely
  215. # need to provide a <Directory> section to allow access to
  216. # the filesystem path.
  217. #
  218. # ScriptAlias: This controls which directories contain server scripts.
  219. # ScriptAliases are essentially the same as Aliases, except that
  220. # documents in the target directory are treated as applications and
  221. # run by the server when requested rather than as documents sent to the
  222. # client. The same rules about trailing "/" apply to ScriptAlias
  223. # directives as to Alias.
  224. #
  225. ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
  226. </IfModule>
  227. #
  228. # "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
  229. # CGI directory exists, if you have that configured.
  230. #
  231. <Directory "/var/www/cgi-bin">
  232. AllowOverride None
  233. Options None
  234. Require all granted
  235. </Directory>
  236. <IfModule mime_module>
  237. #
  238. # TypesConfig points to the file containing the list of mappings from
  239. # filename extension to MIME-type.
  240. #
  241. TypesConfig /etc/mime.types
  242. #
  243. # AddType allows you to add to or override the MIME configuration
  244. # file specified in TypesConfig for specific file types.
  245. #
  246. #AddType application/x-gzip .tgz
  247. #
  248. # AddEncoding allows you to have certain browsers uncompress
  249. # information on the fly. Note: Not all browsers support this.
  250. #
  251. #AddEncoding x-compress .Z
  252. #AddEncoding x-gzip .gz .tgz
  253. #
  254. # If the AddEncoding directives above are commented-out, then you
  255. # probably should define those extensions to indicate media types:
  256. #
  257. AddType application/x-compress .Z
  258. AddType application/x-gzip .gz .tgz
  259. #
  260. # AddHandler allows you to map certain file extensions to "handlers":
  261. # actions unrelated to filetype. These can be either built into the server
  262. # or added with the Action directive (see below)
  263. #
  264. # To use CGI scripts outside of ScriptAliased directories:
  265. # (You will also need to add "ExecCGI" to the "Options" directive.)
  266. #
  267. #AddHandler cgi-script .cgi
  268. # For type maps (negotiated resources):
  269. #AddHandler type-map var
  270. #
  271. # Filters allow you to process content before it is sent to the client.
  272. #
  273. # To parse .shtml files for server-side includes (SSI):
  274. # (You will also need to add "Includes" to the "Options" directive.)
  275. #
  276. AddType text/html .shtml
  277. AddOutputFilter INCLUDES .shtml
  278. </IfModule>
  279. #
  280. # Specify a default charset for all content served; this enables
  281. # interpretation of all content as UTF-8 by default. To use the
  282. # default browser choice (ISO-8859-1), or to allow the META tags
  283. # in HTML content to override this choice, comment out this
  284. # directive:
  285. #
  286. AddDefaultCharset UTF-8
  287. <IfModule mime_magic_module>
  288. #
  289. # The mod_mime_magic module allows the server to use various hints from the
  290. # contents of the file itself to determine its type. The MIMEMagicFile
  291. # directive tells the module where the hint definitions are located.
  292. #
  293. MIMEMagicFile conf/magic
  294. </IfModule>
  295. #
  296. # Customizable error responses come in three flavors:
  297. # 1) plain text 2) local redirects 3) external redirects
  298. #
  299. # Some examples:
  300. #ErrorDocument 500 "The server made a boo boo."
  301. #ErrorDocument 404 /missing.html
  302. #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
  303. #ErrorDocument 402 http://www.example.com/subscription_info.html
  304. #
  305. #
  306. # EnableMMAP and EnableSendfile: On systems that support it,
  307. # memory-mapping or the sendfile syscall may be used to deliver
  308. # files. This usually improves server performance, but must
  309. # be turned off when serving from networked-mounted
  310. # filesystems or if support for these functions is otherwise
  311. # broken on your system.
  312. # Defaults if commented: EnableMMAP On, EnableSendfile Off
  313. #
  314. #EnableMMAP off
  315. EnableSendfile on
  316. # Supplemental configuration
  317. #
  318. # Load config files in the "/etc/httpd/conf.d" directory, if any.
  319. IncludeOptional conf.d/*.conf
  320. IncludeOptional vhosts.d/*.conf