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.

130 lines
4.1KB

  1. # ``apache`` formula configuration:
  2. apache:
  3. # lookup section overrides ``map.jinja`` values
  4. lookup:
  5. server: apache2
  6. service: apache2
  7. vhostdir: /etc/apache2/sites-available
  8. confdir: /etc/apache2/conf.d
  9. confext: .conf
  10. logdir: /var/log/apache2
  11. wwwdir: /srv/apache2
  12. # apache version (generally '2.2' or '2.4')
  13. version: '2.2'
  14. # ``apache.mod_wsgi`` formula additional configuration:
  15. mod_wsgi: mod_wsgi
  16. # ``apache.mod_remoteip`` formula additional configuration:
  17. mod_remoteip:
  18. RemoteIPHeader: X-Forwarded-For
  19. RemoteIPTrustedProxy:
  20. - 10.0.8.0/24
  21. - 127.0.0.1
  22. # ``apache.vhosts`` formula additional configuration:
  23. sites:
  24. example.net:
  25. template_file: salt://apache/vhosts/minimal.tmpl
  26. example.com: # must be unique; used as an ID declaration in Salt.
  27. enabled: True
  28. template_file: salt://apache/vhosts/standard.tmpl # or redirect.tmpl or proxy.tmpl
  29. ####################### DEFAULT VALUES BELOW ############################
  30. # NOTE: the values below are simply default settings that *can* be
  31. # overridden and are not required in order to use this formula to create
  32. # vhost entries.
  33. #
  34. # Do not copy the values below into your Pillar unless you intend to
  35. # modify these vaules.
  36. ####################### DEFAULT VALUES BELOW ############################
  37. template_engine: jinja
  38. interface: '*'
  39. port: '80'
  40. ServerName: example.com # uses the unique ID above unless specified
  41. ServerAlias: www.example.com
  42. ServerAdmin: webmaster@example.com
  43. LogLevel: warn
  44. ErrorLog: /path/to/logs/example.com-error.log # E.g.: /var/log/apache2/example.com-error.log
  45. CustomLog: /path/to/logs/example.com-access.log # E.g.: /var/log/apache2/example.com-access.log
  46. DocumentRoot: /path/to/www/dir/example.com # E.g., /var/www/example.com
  47. SSLCertificateFile: /etc/ssl/mycert.pem # if ssl is desired
  48. SSLCertificateKeyFile: /etc/ssl/mycert.pem.key # if key for cert is needed or in an extra file
  49. SSLCertificateChainFile: /etc/ssl/mycert.chain.pem # if you require a chain of server certificates file
  50. Directory:
  51. # "default" is a special case; Adds ``/path/to/www/dir/example.com``
  52. # E.g.: /var/www/example.com
  53. default:
  54. Options: -Indexes FollowSymLinks
  55. Order: allow,deny # For Apache < 2.4
  56. Allow: from all # For apache < 2.4
  57. Require: all granted # For apache > 2.4.
  58. AllowOverride: None
  59. Formula_Append: |
  60. Additional config as a
  61. multi-line string here
  62. # if template is 'redirect.tmpl'
  63. # RedirectSource: '/'
  64. # RedirectTarget: 'http://www.example.net'
  65. # if template is 'proxy.tmpl'
  66. # ProxyPreserveHost: 'On'
  67. # ProxyRoute:
  68. # my sample route:
  69. # ProxyPassSource: '/'
  70. # ProxyPassTarget: 'http://www.example.net'
  71. # ProxyPassReverseSource: '/'
  72. # ProxyPassReverseTarget: 'http://www.example.net'
  73. Alias:
  74. /docs: /usr/share/docs
  75. Location:
  76. /docs:
  77. Order: allow,deny # For Apache < 2.4
  78. Allow: from all # For apache < 2.4
  79. Require: all granted # For apache > 2.4.
  80. Formula_Append: |
  81. Additional config as a
  82. multi-line string here
  83. Formula_Append: |
  84. Additional config as a
  85. multi-line string here
  86. # ``apache.debian_full`` formula additional configuration:
  87. register-site:
  88. # any name as an array index, and you can duplicate this section
  89. UNIQUE_VALUE_HERE:
  90. name: 'my name'
  91. path: 'salt://path/to/sites-available/conf/file'
  92. state: 'enabled'
  93. # Optional - use managed file as Jinja Template
  94. #template: true
  95. #defaults:
  96. # custom_var: "default value"
  97. modules:
  98. enabled: # List modules to enable
  99. - ldap
  100. - ssl
  101. disabled: # List modules to disable
  102. - rewrite
  103. security:
  104. # can be Full | OS | Minimal | Minor | Major | Prod
  105. # where Full conveys the most information, and Prod the least.
  106. ServerTokens: Prod