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.

пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. ======
  2. apache
  3. ======
  4. Formulas to set up and configure the Apache HTTP server.
  5. .. note::
  6. See the full `Salt Formulas installation and usage instructions
  7. <http://docs.saltstack.com/topics/conventions/formulas.html>`_.
  8. Available states
  9. ================
  10. .. contents::
  11. :local:
  12. ``apache``
  13. ----------
  14. Installs the Apache package and starts the service.
  15. ``apache.mod_proxy``
  16. -------------------
  17. Enables the Apache module mod_proxy.
  18. ``apache.mod_proxy_http``
  19. -------------------
  20. Enables the Apache module mod_proxy_http and requires the Apache module mod_proxy to be enabled.
  21. ``apache.mod_wsgi``
  22. -------------------
  23. Installs the mod_wsgi package and enables the Apache module.
  24. ``apache.vhosts.standard``
  25. -------------------------
  26. Configures Apache name-based virtual hosts using data from Pillar.
  27. Example Pillar:
  28. .. code:: yaml
  29. apache:
  30. sites:
  31. # Default values below are used unless disabled by setting to 'None'.
  32. example.com: # must be unique; used as an ID declaration in Salt; also passed to the template context as {{ id }}
  33. template_file: salt://apache/vhosts/standard.tmpl
  34. template_engine: jinja
  35. interface: '*'
  36. port: '80'
  37. ServerName: {{ id }} # uses the unique ID above unless specified
  38. ServerAlias: www.{{ id }}
  39. ServerAdmin: webmaster@{{ id }}
  40. LogLevel: warn
  41. ErrorLog: {{ logdir }}/{{ id }}-error.log # E.g.: /var/log/apache2/example.com-error.log
  42. CustomLog: {{ logdir }}/{{ id }}-access.log # E.g.: /var/log/apache2/example.com-access.log
  43. DocumentRoot: {{ wwwdir }}/{{ id }} # E.g., /var/www/example.com
  44. Directory:
  45. {{ wwwdir }}/{{ id }}: # E.g.: /var/www/example.com:
  46. Options: -Indexes FollowSymLinks
  47. Order: allow,deny
  48. Allow: from all
  49. AllowOverride: All
  50. Formula_Append: |
  51. Additional config as a
  52. multi-line string here
  53. Formula_Append: |
  54. Additional config as a
  55. multi-line string here
  56. example.net:
  57. template_file: salt://apache/vhosts/minimal.tmpl
  58. ``apache.debian_full``
  59. ----------------------
  60. Installs and configures Apache on Debian and Ubuntu systems.
  61. These states are ordered using the ``order`` declaration. Different stages
  62. are divided into the following number ranges:
  63. 1) apache will use 1-500 for ordering
  64. 2) apache will reserve 1 -100 as unused
  65. 3) apache will reserve 101-150 for pre pkg install
  66. 4) apache will reserve 151-200 for pkg install
  67. 5) apache will reserve 201-250 for pkg configure
  68. 6) apache will reserve 251-300 for downloads, git stuff, load data
  69. 7) apache will reserve 301-400 for unknown purposes
  70. 8) apache will reserve 401-450 for service restart-reloads
  71. 9) apache WILL reserve 451-460 for service.running
  72. 10) apache will reserve 461-500 for cmd requiring operational services
  73. Dependencies:
  74. * `apt <https://github.com/saltstack-formulas/apt-formula>`_
  75. Optional dependencies:
  76. 1) `php <https://github.com/saltstack-formulas/php-formula>`_
  77. Example Pillar:
  78. .. code:: yaml
  79. apache:
  80. register-site:
  81. # any name as an array index, and you can duplicate this section
  82. {{UNQIUE}}:
  83. name: 'my name'
  84. path: 'salt://path/to/sites-available/conf/file'
  85. state: 'enabled'