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

11 лет назад
11 лет назад
11 лет назад
11 лет назад
11 лет назад
11 лет назад
11 лет назад
11 лет назад
11 лет назад
11 лет назад
11 лет назад
11 лет назад
9 лет назад
8 лет назад
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. # ``apache`` formula configuration:
  2. apache:
  3. # lookup section overrides ``map.jinja`` values
  4. lookup:
  5. server: apache2
  6. service: apache2
  7. user: some_system_user
  8. group: some_system_group
  9. vhostdir: /etc/apache2/sites-available
  10. confdir: /etc/apache2/conf.d
  11. confext: .conf
  12. logdir: /var/log/apache2
  13. wwwdir: /srv/apache2
  14. # apache version (generally '2.2' or '2.4')
  15. version: '2.2'
  16. # ``apache.mod_wsgi`` formula additional configuration:
  17. mod_wsgi: mod_wsgi
  18. # Default value for AddDefaultCharset in RedHat configuration
  19. default_charset: 'UTF-8'
  20. global:
  21. # global apache directives
  22. AllowEncodedSlashes: 'On'
  23. name_virtual_hosts:
  24. - interface: '*'
  25. port: 80
  26. - interface: '*'
  27. port: 443
  28. # ``apache.vhosts`` formula additional configuration:
  29. sites:
  30. example.net:
  31. template_file: salt://apache/vhosts/minimal.tmpl
  32. example.com: # must be unique; used as an ID declaration in Salt.
  33. enabled: True
  34. template_file: salt://apache/vhosts/standard.tmpl # or minimal.tmpl or redirect.tmpl or proxy.tmpl
  35. ####################### DEFAULT VALUES BELOW ############################
  36. # NOTE: the values below are simply default settings that *can* be
  37. # overridden and are not required in order to use this formula to create
  38. # vhost entries.
  39. #
  40. # Do not copy the values below into your Pillar unless you intend to
  41. # modify these vaules.
  42. ####################### DEFAULT VALUES BELOW ############################
  43. template_engine: jinja
  44. interface: '*'
  45. port: '80'
  46. exclude_listen_directive: True # Do not add a Listen directive in httpd.conf
  47. ServerName: example.com # uses the unique ID above unless specified
  48. ServerAlias: www.example.com
  49. ServerAdmin: webmaster@example.com
  50. LogLevel: warn
  51. ErrorLog: /path/to/logs/example.com-error.log # E.g.: /var/log/apache2/example.com-error.log
  52. CustomLog: /path/to/logs/example.com-access.log # E.g.: /var/log/apache2/example.com-access.log
  53. DocumentRoot: /path/to/www/dir/example.com # E.g., /var/www/example.com
  54. SSLCertificateFile: /etc/ssl/mycert.pem # if ssl is desired
  55. SSLCertificateKeyFile: /etc/ssl/mycert.pem.key # if key for cert is needed or in an extra file
  56. SSLCertificateChainFile: /etc/ssl/mycert.chain.pem # if you require a chain of server certificates file
  57. Directory:
  58. # "default" is a special case; Adds ``/path/to/www/dir/example.com``
  59. # E.g.: /var/www/example.com
  60. default:
  61. Options: -Indexes +FollowSymLinks
  62. Order: allow,deny # For Apache < 2.4
  63. Allow: from all # For apache < 2.4
  64. Require: all granted # For apache > 2.4.
  65. AllowOverride: None
  66. Formula_Append: |
  67. Additional config as a
  68. multi-line string here
  69. 80-proxyexample.com:
  70. template_file: salt://apache/vhosts/redirect.tmpl
  71. ServerName: www.proxyexample.com
  72. ServerAlias: www.proxyexample.com
  73. RedirectSource: '/'
  74. RedirectTarget: 'https://www.proxyexample.com/'
  75. DocumentRoot: /var/www/proxy
  76. 443-proxyexample.com:
  77. template_file: salt://apache/vhosts/proxy.tmpl
  78. ServerName: www.proxyexample.com
  79. ServerAlias: www.proxyexample.com
  80. interface: '*'
  81. port: '443'
  82. DocumentRoot: /var/www/proxy
  83. Rewrite: |
  84. RewriteRule ^/webmail$ /webmail/ [R]
  85. RewriteRule ^/webmail(.*) http://mail.example.com$1 [P,L]
  86. RewriteRule ^/vicescws(.*) http://svc.example.com:92$1 [P,L]
  87. SSLCertificateFile: /etc/httpd/ssl/example.com.crt
  88. SSLCertificateKeyFile: /etc/httpd/ssl/example.com.key
  89. SSLCertificateChainFile: /etc/httpd/ssl/example.com.cer
  90. SSLCertificateFile_content: |
  91. -----BEGIN CERTIFICATE-----
  92. MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL
  93. MAkGA1UECBMCUE4xCzAJBgNVBAcTAkNOMQswCQYDVQQKEwJPTjELMAkGA1UECxMC
  94. VU4xFDASBgNVBAMTC0hlcm9uZyBZYW5nMB4XDTA1MDcxNTIxMTk0N1oXDTA1MDgx
  95. NDIxMTk0N1owVzELMAkGA1UEBhMCQ04xCzAJBgNVBAgTAlBOMQswCQYDVQQHEwJD
  96. TjELMAkGA1UEChMCT04xCzAJBgNVBAsTAlVOMRQwEgYDVQQDEwtIZXJvbmcgWWFu
  97. ZzBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQCp5hnG7ogBhtlynpOS21cBewKE/B7j
  98. V14qeyslnr26xZUsSVko36ZnhiaO/zbMOoRcKK9vEcgMtcLFuQTWDl3RAgMBAAGj
  99. gbEwga4wHQYDVR0OBBYEFFXI70krXeQDxZgbaCQoR4jUDncEMH8GA1UdIwR4MHaA
  100. FFXI70krXeQDxZgbaCQoR4jUDncEoVukWTBXMQswCQYDVQQGEwJDTjELMAkGA1UE
  101. CBMCUE4xCzAJBgNVBAcTAkNOMQswCQYDVQQKEwJPTjELMAkGA1UECxMCVU4xFDAS
  102. BgNVBAMTC0hlcm9uZyBZYW5nggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEE
  103. BQADQQA/ugzBrjjK9jcWnDVfGHlk3icNRq0oV7Ri32z/+HQX67aRfgZu7KWdI+Ju
  104. Wm7DCfrPNGVwFWUQOmsPue9rZBgO
  105. -----END CERTIFICATE-----
  106. SSLCertificateKeyFile_content: |
  107. -----BEGIN PRIVATE KEY-----
  108. MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL
  109. MAkGA1UECBMCUE4xCzAJBgNVBAcTAkNOMQswCQYDVQQKEwJPTjELMAkGA1UECxMC
  110. VU4xFDASBgNVBAMTC0hlcm9uZyBZYW5nMB4XDTA1MDcxNTIxMTk0N1oXDTA1MDgx
  111. NDIxMTk0N1owVzELMAkGA1UEBhMCQ04xCzAJBgNVBAgTAlBOMQswCQYDVQQHEwJD
  112. TjELMAkGA1UEChMCT04xCzAJBgNVBAsTAlVOMRQwEgYDVQQDEwtIZXJvbmcgWWFu
  113. ZzBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQCp5hnG7ogBhtlynpOS21cBewKE/B7j
  114. V14qeyslnr26xZUsSVko36ZnhiaO/zbMOoRcKK9vEcgMtcLFuQTWDl3RAgMBAAGj
  115. gbEwga4wHQYDVR0OBBYEFFXI70krXeQDxZgbaCQoR4jUDncEMH8GA1UdIwR4MHaA
  116. FFXI70krXeQDxZgbaCQoR4jUDncEoVukWTBXMQswCQYDVQQGEwJDTjELMAkGA1UE
  117. CBMCUE4xCzAJBgNVBAcTAkNOMQswCQYDVQQKEwJPTjELMAkGA1UECxMCVU4xFDAS
  118. BgNVBAMTC0hlcm9uZyBZYW5nggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEE
  119. BQADQQA/ugzBrjjK9jcWnDVfGHlk3icNRq0oV7Ri32z/+HQX67aRfgZu7KWdI+Ju
  120. Wm7DCfrPNGVwFWUQOmsPue9rZBgO
  121. -----END PRIVATE KEY-----
  122. SSLCertificateChainFile_content: |
  123. -----BEGIN CERTIFICATE-----
  124. MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL
  125. MAkGA1UECBMCUE4xCzAJBgNVBAcTAkNOMQswCQYDVQQKEwJPTjELMAkGA1UECxMC
  126. VU4xFDASBgNVBAMTC0hlcm9uZyBZYW5nMB4XDTA1MDcxNTIxMTk0N1oXDTA1MDgx
  127. NDIxMTk0N1owVzELMAkGA1UEBhMCQ04xCzAJBgNVBAgTAlBOMQswCQYDVQQHEwJD
  128. TjELMAkGA1UEChMCT04xCzAJBgNVBAsTAlVOMRQwEgYDVQQDEwtIZXJvbmcgWWFu
  129. ZzBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQCp5hnG7ogBhtlynpOS21cBewKE/B7j
  130. V14qeyslnr26xZUsSVko36ZnhiaO/zbMOoRcKK9vEcgMtcLFuQTWDl3RAgMBAAGj
  131. gbEwga4wHQYDVR0OBBYEFFXI70krXeQDxZgbaCQoR4jUDncEMH8GA1UdIwR4MHaA
  132. FFXI70krXeQDxZgbaCQoR4jUDncEoVukWTBXMQswCQYDVQQGEwJDTjELMAkGA1UE
  133. CBMCUE4xCzAJBgNVBAcTAkNOMQswCQYDVQQKEwJPTjELMAkGA1UECxMCVU4xFDAS
  134. BgNVBAMTC0hlcm9uZyBZYW5nggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEE
  135. BQADQQA/ugzBrjjK9jcWnDVfGHlk3icNRq0oV7Ri32z/+HQX67aRfgZu7KWdI+Ju
  136. Wm7DCfrPNGVwFWUQOmsPue9rZBgO
  137. -----END CERTIFICATE-----
  138. -----BEGIN CERTIFICATE-----
  139. MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL
  140. MAkGA1UECBMCUE4xCzAJBgNVBAcTAkNOMQswCQYDVQQKEwJPTjELMAkGA1UECxMC
  141. VU4xFDASBgNVBAMTC0hlcm9uZyBZYW5nMB4XDTA1MDcxNTIxMTk0N1oXDTA1MDgx
  142. NDIxMTk0N1owVzELMAkGA1UEBhMCQ04xCzAJBgNVBAgTAlBOMQswCQYDVQQHEwJD
  143. TjELMAkGA1UEChMCT04xCzAJBgNVBAsTAlVOMRQwEgYDVQQDEwtIZXJvbmcgWWFu
  144. ZzBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQCp5hnG7ogBhtlynpOS21cBewKE/B7j
  145. V14qeyslnr26xZUsSVko36ZnhiaO/zbMOoRcKK9vEcgMtcLFuQTWDl3RAgMBAAGj
  146. gbEwga4wHQYDVR0OBBYEFFXI70krXeQDxZgbaCQoR4jUDncEMH8GA1UdIwR4MHaA
  147. FFXI70krXeQDxZgbaCQoR4jUDncEoVukWTBXMQswCQYDVQQGEwJDTjELMAkGA1UE
  148. CBMCUE4xCzAJBgNVBAcTAkNOMQswCQYDVQQKEwJPTjELMAkGA1UECxMCVU4xFDAS
  149. BgNVBAMTC0hlcm9uZyBZYW5nggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEE
  150. BQADQQA/ugzBrjjK9jcWnDVfGHlk3icNRq0oV7Ri32z/+HQX67aRfgZu7KWdI+Ju
  151. Wm7DCfrPNGVwFWUQOmsPue9rZBgO
  152. -----END CERTIFICATE-----
  153. ProxyRequests: 'Off'
  154. ProxyPreserveHost: 'On'
  155. ProxyRoute:
  156. example prod proxy route:
  157. ProxyPassSource: '/'
  158. ProxyPassTarget: 'http://prod.example.com:85/'
  159. ProxyPassTargetOptions: 'connectiontimeout=10 timeout=90'
  160. ProxyPassReverseSource: '/'
  161. ProxyPassReverseTarget: 'http://prod.example.com:85/'
  162. example webmail proxy route:
  163. ProxyPassSource: '/webmail/'
  164. ProxyPassTarget: 'http://mail.example.com/'
  165. ProxyPassTargetOptions: 'connectiontimeout=10 timeout=90'
  166. ProxyPassReverseSource: '/webmail/'
  167. ProxyPassReverseTarget: 'http://mail.example.com/'
  168. example service proxy route:
  169. ProxyPassSource: '/svc/'
  170. ProxyPassTarget: 'http://svc.example.com:92/'
  171. ProxyPassTargetOptions: 'connectiontimeout=10 timeout=90'
  172. ProxyPassReverseSource: '/svc/'
  173. ProxyPassReverseTarget: 'http://svc.example.com:92/'
  174. Location:
  175. /:
  176. Require: False
  177. Formula_Append: |
  178. SecRuleRemoveById 981231
  179. SecRuleRemoveById 981173
  180. /error:
  181. Require: 'all granted'
  182. LocationMatch:
  183. '^[.\\/]+([Ww][Ee][Bb][Mm][Aa][Ii][Ll])[.\\/]':
  184. Require: False
  185. Formula_Append: |
  186. RequestHeader set Host mail.example.com
  187. '^[.\\/]+([Ss][Vv][Cc])[.\\/]':
  188. Require: False
  189. Formula_Append: |
  190. Require ip 123.123.13.6 84.24.25.74
  191. Proxy_control:
  192. '*':
  193. AllowAll: False
  194. AllowCountry:
  195. - DE
  196. AllowIP:
  197. - 12.5.25.32
  198. - 12.5.25.33
  199. Alias:
  200. /docs: /usr/share/docs
  201. Location:
  202. /docs:
  203. Order: allow,deny # For Apache < 2.4
  204. Allow: from all # For apache < 2.4
  205. Require: all granted # For apache > 2.4.
  206. Formula_Append: |
  207. Additional config as a
  208. multi-line string here
  209. Formula_Append: |
  210. Additional config as a
  211. multi-line string here
  212. # ``apache.debian_full`` formula additional configuration:
  213. register-site:
  214. # any name as an array index, and you can duplicate this section
  215. UNIQUE_VALUE_HERE:
  216. name: 'my name'
  217. path: 'salt://path/to/sites-available/conf/file'
  218. state: 'enabled'
  219. # Optional - use managed file as Jinja Template
  220. #template: true
  221. #defaults:
  222. # custom_var: "default value"
  223. modules:
  224. enabled: # List modules to enable
  225. - ldap
  226. - ssl
  227. disabled: # List modules to disable
  228. - rewrite
  229. # KeepAlive: Whether or not to allow persistent connections (more than
  230. # one request per connection). Set to "Off" to deactivate.
  231. keepalive: 'On'
  232. security:
  233. # can be Full | OS | Minimal | Minor | Major | Prod
  234. # where Full conveys the most information, and Prod the least.
  235. ServerTokens: Prod
  236. # ``apache.mod_remoteip`` formula additional configuration:
  237. mod_remoteip:
  238. RemoteIPHeader: X-Forwarded-For
  239. RemoteIPTrustedProxy:
  240. - 10.0.8.0/24
  241. - 127.0.0.1
  242. # ``apache.mod_security`` formula additional configuration:
  243. mod_security:
  244. crs_install: True
  245. # If not set, default distro's configuration is installed as is
  246. manage_config: True
  247. sec_rule_engine: 'On'
  248. sec_request_body_access: 'On'
  249. sec_request_body_limit: '14000000'
  250. sec_request_body_no_files_limit: '114002'
  251. sec_request_body_in_memory_limit: '114002'
  252. sec_request_body_limit_action: 'Reject'
  253. sec_pcre_match_limit: '15000'
  254. sec_pcre_match_limit_recursion: '15000'
  255. sec_debug_log_level: '3'
  256. rules:
  257. enabled:
  258. modsecurity_crs_10_setup.conf:
  259. rule_set: ''
  260. enabled: True
  261. modsecurity_crs_20_protocol_violations.conf:
  262. rule_set: 'base_rules'
  263. enabled: False
  264. custom_rule_files:
  265. # any name as an array index, and you can duplicate this section
  266. UNIQUE_VALUE_HERE:
  267. file: 'my name'
  268. path: 'salt://path/to/modsecurity/custom/file'
  269. enabled: True