Saltstack Official Apache Formula
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

README.rst 7.9KB

11 lat temu
11 lat temu
10 lat temu
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. .. _readme:
  2. apache
  3. ======
  4. |img_travis| |img_sr|
  5. .. |img_travis| image:: https://travis-ci.com/saltstack-formulas/apache-formula.svg?branch=master
  6. :alt: Travis CI Build Status
  7. :scale: 100%
  8. :target: https://travis-ci.com/saltstack-formulas/apache-formula
  9. .. |img_sr| image:: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
  10. :alt: Semantic Release
  11. :scale: 100%
  12. :target: https://github.com/semantic-release/semantic-release
  13. Formulas to set up and configure the Apache HTTP server.
  14. .. contents:: **Table of Contents**
  15. General notes
  16. -------------
  17. See the full `SaltStack Formulas installation and usage instructions
  18. <https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html>`_.
  19. If you are interested in writing or contributing to formulas, please pay attention to the `Writing Formula Section
  20. <https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html#writing-formulas>`_.
  21. If you want to use this formula, please pay attention to the ``FORMULA`` file and/or ``git tag``,
  22. which contains the currently released version. This formula is versioned according to `Semantic Versioning <http://semver.org/>`_.
  23. See `Formula Versioning Section <https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html#versioning>`_ for more details.
  24. Contributing to this repo
  25. -------------------------
  26. **Commit message formatting is significant!!**
  27. Please see `How to contribute <https://github.com/saltstack-formulas/.github/blob/master/CONTRIBUTING.rst>`_ for more details.
  28. Available states
  29. ----------------
  30. .. contents::
  31. :local:
  32. ``apache``
  33. ^^^^^^^^^^
  34. Installs the Apache package and starts the service.
  35. ``apache.config``
  36. ^^^^^^^^^^^^^^^^^
  37. Configures apache based on os_family
  38. ``apache.certificates``
  39. ^^^^^^^^^^^^^^^^^^^^^^^
  40. Deploy SSL certificates from pillars
  41. ``apache.mod_mpm``
  42. ^^^^^^^^^^^^^^^^^^
  43. Configures the apache mpm modules on Debian ``mpm_prefork``, ``mpm_worker`` or ``mpm_event`` (Debian Only)
  44. ``apache.modules``
  45. ^^^^^^^^^^^^^^^^^^
  46. Enables and disables Apache modules.
  47. ``apache.mod_rewrite``
  48. ^^^^^^^^^^^^^^^^^^^^^^
  49. Enabled the Apache module mod_rewrite (Debian and FreeBSD only)
  50. ``apache.mod_proxy``
  51. ^^^^^^^^^^^^^^^^^^^^
  52. Enables the Apache module mod_proxy. (Debian and FreeBSD only)
  53. ``apache.mod_proxy_http``
  54. ^^^^^^^^^^^^^^^^^^^^^^^^^
  55. Enables the Apache module mod_proxy_http and requires the Apache module mod_proxy to be enabled. (Debian Only)
  56. ``apache.mod_proxy_fcgi``
  57. ^^^^^^^^^^^^^^^^^^^^^^^^^
  58. Enables the Apache module mod_proxy_fcgi and requires the Apache module mod_proxy to be enabled. (Debian Only)
  59. ``apache.mod_wsgi``
  60. ^^^^^^^^^^^^^^^^^^^
  61. Installs the mod_wsgi package and enables the Apache module.
  62. ``apache.mod_actions``
  63. ^^^^^^^^^^^^^^^^^^^^^^
  64. Enables the Apache module mod_actions. (Debian Only)
  65. ``apache.mod_headers``
  66. ^^^^^^^^^^^^^^^^^^^^^^
  67. Enables the Apache module mod_headers. (Debian Only)
  68. ``apache.mod_pagespeed``
  69. ^^^^^^^^^^^^^^^^^^^^^^^^
  70. Installs and Enables the mod_pagespeed module. (Debian and RedHat Only)
  71. ``apache.mod_perl2``
  72. ^^^^^^^^^^^^^^^^^^^^
  73. Installs and enables the mod_perl2 module (Debian and FreeBSD only)
  74. ``apache.mod_geoip``
  75. ^^^^^^^^^^^^^^^^^^^^
  76. Installs and enables the mod_geoIP (RedHat only)
  77. ``apache.mod_php5``
  78. ^^^^^^^^^^^^^^^^^^^
  79. Installs and enables the mod_php5 module
  80. ``apache.mod_cgi``
  81. ^^^^^^^^^^^^^^^^^^
  82. Enables mod_cgi. (FreeBSD only)
  83. ``apache.mod_fcgid``
  84. ^^^^^^^^^^^^^^^^^^^^
  85. Installs and enables the mod_fcgid module (Debian only)
  86. ``apache.mod_fastcgi``
  87. ^^^^^^^^^^^^^^^^^^^^^^
  88. Installs and enables the mod_fastcgi module
  89. ``apache.mod_dav_svn``
  90. ^^^^^^^^^^^^^^^^^^^^^^
  91. Installs and enables the mod_dav_svn module (Debian only)
  92. ``apache.mod_security``
  93. ^^^^^^^^^^^^^^^^^^^^^^^
  94. Installs an enables the `Apache mod_security2 WAF`<http://modsecurity.org/>`_
  95. using data from Pillar. (Debian and RedHat Only)
  96. Allows you to install the basic Core Rules (CRS) and some basic configuration for mod_security2
  97. ``apache.mod_security.rules``
  98. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  99. This state can create symlinks based on basic Core Rules package. (Debian only)
  100. Or it can distribute a mod_security rule file and place it /etc/modsecurity/
  101. ``apache.mod_socache_shmcb``
  102. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  103. Enables mod_socache_shmcb. (FreeBSD only)
  104. ``apache.mod_ssl``
  105. ^^^^^^^^^^^^^^^^^^
  106. Installs and enables the mod_ssl module (Debian, RedHat and FreeBSD only)
  107. ``apache.mod_suexec``
  108. ^^^^^^^^^^^^^^^^^^^^^
  109. Enables mod_suexec. (FreeBSD only)
  110. ``apache.mod_vhost_alias``
  111. ^^^^^^^^^^^^^^^^^^^^^^^^^^
  112. Enables the Apache module vhost_alias (Debian Only)
  113. ``apache.mod_remoteip``
  114. ^^^^^^^^^^^^^^^^^^^^^^^
  115. Enables and configures the Apache module mod_remoteip using data from Pillar. (Debian Only)
  116. ``apache.mod_xsendfile``
  117. ^^^^^^^^^^^^^^^^^^^^^^^^
  118. Installs and enables mod_xsendfile module. (Debian Only)
  119. ``apache.own_default_vhost``
  120. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  121. Replace default vhost with own version. By default, it's 503 code. (Debian Only)
  122. ``apache.no_default_vhost``
  123. ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  124. Remove the default vhost. (Debian Only)
  125. ``apache.vhosts.standard``
  126. ^^^^^^^^^^^^^^^^^^^^^^^^^^
  127. Configures Apache name-based virtual hosts and creates virtual host directories using data from Pillar.
  128. Example Pillar:
  129. .. code:: yaml
  130. apache:
  131. sites:
  132. example.com: # must be unique; used as an ID declaration in Salt; also passed to the template context as {{ id }}
  133. template_file: salt://apache/vhosts/standard.tmpl
  134. When using the provided templates, one can use a space separated list
  135. of interfaces to bind to. For example, to bind both IPv4 and IPv6:
  136. .. code:: yaml
  137. apache:
  138. sites:
  139. example.com:
  140. interface: '1.2.3.4 [2001:abc:def:100::3]'
  141. ``apache.manage_security``
  142. ^^^^^^^^^^^^^^^^^^^^^^^^^^
  143. Configures Apache's security.conf options by reassinging them using data from Pillar.
  144. ``apache.server_status``
  145. ^^^^^^^^^^^^^^^^^^^^^^^^
  146. Configures Apache's server_status handler for localhost
  147. ``apache.debian_full``
  148. ^^^^^^^^^^^^^^^^^^^^^^
  149. Installs and configures Apache on Debian and Ubuntu systems.
  150. ``apache.uninstall``
  151. ^^^^^^^^^^^^^^^^^^^^
  152. Stops the Apache service and uninstalls the package.
  153. These states are ordered using the ``order`` declaration. Different stages
  154. are divided into the following number ranges:
  155. 1) apache will use 1-500 for ordering
  156. 2) apache will reserve 1 -100 as unused
  157. 3) apache will reserve 101-150 for pre pkg install
  158. 4) apache will reserve 151-200 for pkg install
  159. 5) apache will reserve 201-250 for pkg configure
  160. 6) apache will reserve 251-300 for downloads, git stuff, load data
  161. 7) apache will reserve 301-400 for unknown purposes
  162. 8) apache will reserve 401-450 for service restart-reloads
  163. 9) apache WILL reserve 451-460 for service.running
  164. 10) apache will reserve 461-500 for cmd requiring operational services
  165. Example Pillar:
  166. .. code:: yaml
  167. apache:
  168. register-site:
  169. # any name as an array index, and you can duplicate this section
  170. {{UNIQUE}}:
  171. name: 'my name'
  172. path: 'salt://path/to/sites-available/conf/file'
  173. state: 'enabled'
  174. Testing
  175. -------
  176. Linux testing is done with ``kitchen-salt``.
  177. Requirements
  178. ^^^^^^^^^^^^
  179. * Ruby
  180. * Docker
  181. .. code-block:: bash
  182. $ gem install bundler
  183. $ bundle install
  184. $ bin/kitchen test [platform]
  185. Where ``[platform]`` is the platform name defined in ``kitchen.yml``,
  186. e.g. ``debian-9-2019-2-py3``.
  187. ``bin/kitchen converge``
  188. ^^^^^^^^^^^^^^^^^^^^^^^^
  189. Creates the docker instance and runs the ``template`` main state, ready for testing.
  190. ``bin/kitchen verify``
  191. ^^^^^^^^^^^^^^^^^^^^^^
  192. Runs the ``inspec`` tests on the actual instance.
  193. ``bin/kitchen destroy``
  194. ^^^^^^^^^^^^^^^^^^^^^^^
  195. Removes the docker instance.
  196. ``bin/kitchen test``
  197. ^^^^^^^^^^^^^^^^^^^^
  198. Runs all of the stages above in one go: i.e. ``destroy`` + ``converge`` + ``verify`` + ``destroy``.
  199. ``bin/kitchen login``
  200. ^^^^^^^^^^^^^^^^^^^^^
  201. Gives you SSH access to the instance for manual testing.