freighthop 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (322) hide show
  1. data/Puppetfile +4 -3
  2. data/Puppetfile.lock +14 -2
  3. data/Vagrantfile +5 -1
  4. data/data/common.json +4 -3
  5. data/freighthop.gemspec +1 -1
  6. data/lib/freighthop/cli/checks.rb +12 -0
  7. data/lib/freighthop/cli/help.rb +7 -0
  8. data/lib/freighthop/cli/init.rb +35 -0
  9. data/lib/freighthop/cli/ssh.rb +1 -0
  10. data/lib/freighthop/cli/vagrant.rb +1 -0
  11. data/lib/freighthop/cli.rb +5 -17
  12. data/lib/freighthop/config.rb +5 -1
  13. data/lib/freighthop/version.rb +1 -1
  14. data/lib/freighthop.rb +6 -1
  15. data/local_modules/freighthop/manifests/database/mysql/grant.pp +11 -0
  16. data/local_modules/freighthop/manifests/database/mysql.pp +5 -15
  17. data/local_modules/freighthop/manifests/database/postgres.pp +2 -2
  18. data/local_modules/freighthop/manifests/database.pp +3 -3
  19. data/local_modules/freighthop/manifests/init.pp +6 -23
  20. data/local_modules/freighthop/manifests/language/ruby.pp +5 -25
  21. data/local_modules/freighthop/manifests/language.pp +1 -4
  22. data/local_modules/freighthop/manifests/packages.pp +2 -12
  23. data/local_modules/freighthop/manifests/params.pp +19 -11
  24. data/local_modules/freighthop/manifests/web/apache.pp +60 -0
  25. data/local_modules/freighthop/manifests/web/nginx.pp +22 -0
  26. data/local_modules/freighthop/manifests/web/ssl.pp +13 -0
  27. data/local_modules/freighthop/manifests/web.pp +25 -21
  28. data/local_modules/freighthop/templates/apache/passenger.conf.erb +18 -0
  29. data/local_modules/freighthop/templates/nginx/vagrant-rails.conf.erb +5 -3
  30. data/modules/apache/CHANGELOG.md +172 -0
  31. data/modules/apache/CONTRIBUTING.md +234 -0
  32. data/modules/apache/Gemfile +25 -0
  33. data/modules/apache/LICENSE +15 -0
  34. data/modules/apache/Modulefile +12 -0
  35. data/modules/apache/README.md +1515 -0
  36. data/modules/apache/README.passenger.md +93 -0
  37. data/modules/apache/Rakefile +1 -0
  38. data/modules/apache/files/httpd +24 -0
  39. data/modules/apache/lib/puppet/provider/a2mod/a2mod.rb +35 -0
  40. data/modules/apache/lib/puppet/provider/a2mod/gentoo.rb +116 -0
  41. data/modules/apache/lib/puppet/provider/a2mod/modfix.rb +12 -0
  42. data/modules/apache/lib/puppet/provider/a2mod/redhat.rb +60 -0
  43. data/modules/apache/lib/puppet/provider/a2mod.rb +34 -0
  44. data/modules/apache/lib/puppet/type/a2mod.rb +30 -0
  45. data/modules/apache/manifests/balancer.pp +80 -0
  46. data/modules/apache/manifests/balancermember.pp +52 -0
  47. data/modules/apache/manifests/confd/no_accf.pp +10 -0
  48. data/modules/apache/manifests/default_confd_files.pp +12 -0
  49. data/modules/apache/manifests/default_mods/load.pp +8 -0
  50. data/modules/apache/manifests/default_mods.pp +108 -0
  51. data/modules/apache/manifests/dev.pp +11 -0
  52. data/modules/apache/manifests/init.pp +329 -0
  53. data/modules/apache/manifests/listen.pp +9 -0
  54. data/modules/apache/manifests/mod/alias.pp +17 -0
  55. data/modules/apache/manifests/mod/auth_basic.pp +3 -0
  56. data/modules/apache/manifests/mod/auth_kerb.pp +5 -0
  57. data/modules/apache/manifests/mod/authnz_ldap.pp +19 -0
  58. data/modules/apache/manifests/mod/autoindex.pp +12 -0
  59. data/modules/apache/manifests/mod/cache.pp +3 -0
  60. data/modules/apache/manifests/mod/cgi.pp +4 -0
  61. data/modules/apache/manifests/mod/cgid.pp +23 -0
  62. data/modules/apache/manifests/mod/dav.pp +3 -0
  63. data/modules/apache/manifests/mod/dav_fs.pp +20 -0
  64. data/modules/apache/manifests/mod/dav_svn.pp +5 -0
  65. data/modules/apache/manifests/mod/deflate.pp +12 -0
  66. data/modules/apache/manifests/mod/dev.pp +5 -0
  67. data/modules/apache/manifests/mod/dir.pp +21 -0
  68. data/modules/apache/manifests/mod/disk_cache.pp +24 -0
  69. data/modules/apache/manifests/mod/event.pp +54 -0
  70. data/modules/apache/manifests/mod/expires.pp +3 -0
  71. data/modules/apache/manifests/mod/fastcgi.pp +24 -0
  72. data/modules/apache/manifests/mod/fcgid.pp +3 -0
  73. data/modules/apache/manifests/mod/headers.pp +3 -0
  74. data/modules/apache/manifests/mod/include.pp +3 -0
  75. data/modules/apache/manifests/mod/info.pp +14 -0
  76. data/modules/apache/manifests/mod/itk.pp +64 -0
  77. data/modules/apache/manifests/mod/ldap.pp +12 -0
  78. data/modules/apache/manifests/mod/mime.pp +21 -0
  79. data/modules/apache/manifests/mod/mime_magic.pp +14 -0
  80. data/modules/apache/manifests/mod/negotiation.pp +12 -0
  81. data/modules/apache/manifests/mod/nss.pp +25 -0
  82. data/modules/apache/manifests/mod/passenger.pp +38 -0
  83. data/modules/apache/manifests/mod/perl.pp +3 -0
  84. data/modules/apache/manifests/mod/peruser.pp +73 -0
  85. data/modules/apache/manifests/mod/php.pp +26 -0
  86. data/modules/apache/manifests/mod/prefork.pp +74 -0
  87. data/modules/apache/manifests/mod/proxy.pp +15 -0
  88. data/modules/apache/manifests/mod/proxy_ajp.pp +4 -0
  89. data/modules/apache/manifests/mod/proxy_balancer.pp +10 -0
  90. data/modules/apache/manifests/mod/proxy_html.pp +28 -0
  91. data/modules/apache/manifests/mod/proxy_http.pp +4 -0
  92. data/modules/apache/manifests/mod/python.pp +5 -0
  93. data/modules/apache/manifests/mod/reqtimeout.pp +12 -0
  94. data/modules/apache/manifests/mod/rewrite.pp +4 -0
  95. data/modules/apache/manifests/mod/rpaf.pp +20 -0
  96. data/modules/apache/manifests/mod/setenvif.pp +12 -0
  97. data/modules/apache/manifests/mod/ssl.pp +26 -0
  98. data/modules/apache/manifests/mod/status.pp +42 -0
  99. data/modules/apache/manifests/mod/suphp.pp +14 -0
  100. data/modules/apache/manifests/mod/userdir.pp +17 -0
  101. data/modules/apache/manifests/mod/vhost_alias.pp +3 -0
  102. data/modules/apache/manifests/mod/worker.pp +75 -0
  103. data/modules/apache/manifests/mod/wsgi.pp +21 -0
  104. data/modules/apache/manifests/mod/xsendfile.pp +4 -0
  105. data/modules/apache/manifests/mod.pp +120 -0
  106. data/modules/apache/manifests/namevirtualhost.pp +9 -0
  107. data/modules/apache/manifests/package.pp +48 -0
  108. data/modules/apache/manifests/params.pp +207 -0
  109. data/modules/apache/manifests/peruser/multiplexer.pp +17 -0
  110. data/modules/apache/manifests/peruser/processor.pp +17 -0
  111. data/modules/apache/manifests/php.pp +18 -0
  112. data/modules/apache/manifests/proxy.pp +15 -0
  113. data/modules/apache/manifests/python.pp +18 -0
  114. data/modules/apache/manifests/service.pp +35 -0
  115. data/modules/apache/manifests/ssl.pp +18 -0
  116. data/modules/apache/manifests/vhost.pp +516 -0
  117. data/modules/apache/spec/acceptance/basic_spec.rb +12 -0
  118. data/modules/apache/spec/acceptance/class_spec.rb +58 -0
  119. data/modules/apache/spec/acceptance/default_mods_spec.rb +97 -0
  120. data/modules/apache/spec/acceptance/itk_spec.rb +35 -0
  121. data/modules/apache/spec/acceptance/mod_php_spec.rb +52 -0
  122. data/modules/apache/spec/acceptance/mod_suphp_spec.rb +44 -0
  123. data/modules/apache/spec/acceptance/nodesets/centos-64-x64.yml +8 -0
  124. data/modules/apache/spec/acceptance/nodesets/default.yml +8 -0
  125. data/modules/apache/spec/acceptance/nodesets/ubuntu-server-12042-x64.yml +8 -0
  126. data/modules/apache/spec/acceptance/nodesets/vagrant.key +27 -0
  127. data/modules/apache/spec/acceptance/prefork_worker_spec.rb +81 -0
  128. data/modules/apache/spec/acceptance/service_spec.rb +19 -0
  129. data/modules/apache/spec/acceptance/vhost_spec.rb +290 -0
  130. data/modules/apache/spec/classes/apache_spec.rb +464 -0
  131. data/modules/apache/spec/classes/dev_spec.rb +38 -0
  132. data/modules/apache/spec/classes/mod/auth_kerb_spec.rb +41 -0
  133. data/modules/apache/spec/classes/mod/authnz_ldap_spec.rb +65 -0
  134. data/modules/apache/spec/classes/mod/dav_svn_spec.rb +41 -0
  135. data/modules/apache/spec/classes/mod/dev_spec.rb +23 -0
  136. data/modules/apache/spec/classes/mod/dir_spec.rb +88 -0
  137. data/modules/apache/spec/classes/mod/event_spec.rb +17 -0
  138. data/modules/apache/spec/classes/mod/fastcgi_spec.rb +32 -0
  139. data/modules/apache/spec/classes/mod/fcgid_spec.rb +41 -0
  140. data/modules/apache/spec/classes/mod/info_spec.rb +99 -0
  141. data/modules/apache/spec/classes/mod/itk_spec.rb +31 -0
  142. data/modules/apache/spec/classes/mod/mime_magic_spec.rb +93 -0
  143. data/modules/apache/spec/classes/mod/passenger_spec.rb +112 -0
  144. data/modules/apache/spec/classes/mod/perl_spec.rb +41 -0
  145. data/modules/apache/spec/classes/mod/peruser_spec.rb +17 -0
  146. data/modules/apache/spec/classes/mod/php_spec.rb +99 -0
  147. data/modules/apache/spec/classes/mod/prefork_spec.rb +47 -0
  148. data/modules/apache/spec/classes/mod/proxy_html_spec.rb +45 -0
  149. data/modules/apache/spec/classes/mod/python_spec.rb +41 -0
  150. data/modules/apache/spec/classes/mod/rpaf_spec.rb +77 -0
  151. data/modules/apache/spec/classes/mod/ssl_spec.rb +53 -0
  152. data/modules/apache/spec/classes/mod/status_spec.rb +166 -0
  153. data/modules/apache/spec/classes/mod/suphp_spec.rb +27 -0
  154. data/modules/apache/spec/classes/mod/worker_spec.rb +44 -0
  155. data/modules/apache/spec/classes/mod/wsgi_spec.rb +54 -0
  156. data/modules/apache/spec/classes/params_spec.rb +21 -0
  157. data/modules/apache/spec/classes/service_spec.rb +109 -0
  158. data/modules/apache/spec/defines/mod_spec.rb +105 -0
  159. data/modules/apache/spec/defines/vhost_spec.rb +1152 -0
  160. data/modules/apache/spec/fixtures/modules/site_apache/templates/fake.conf.erb +1 -0
  161. data/modules/apache/spec/spec.opts +4 -0
  162. data/modules/apache/spec/spec_helper.rb +1 -0
  163. data/modules/apache/spec/spec_helper_acceptance.rb +27 -0
  164. data/modules/apache/spec/unit/provider/a2mod/gentoo_spec.rb +184 -0
  165. data/modules/apache/templates/confd/no-accf.conf.erb +4 -0
  166. data/modules/apache/templates/httpd.conf.erb +92 -0
  167. data/modules/apache/templates/listen.erb +6 -0
  168. data/modules/apache/templates/mod/alias.conf.erb +9 -0
  169. data/modules/apache/templates/mod/authnz_ldap.conf.erb +5 -0
  170. data/modules/apache/templates/mod/autoindex.conf.erb +56 -0
  171. data/modules/apache/templates/mod/cgid.conf.erb +1 -0
  172. data/modules/apache/templates/mod/dav_fs.conf.erb +1 -0
  173. data/modules/apache/templates/mod/deflate.conf.erb +4 -0
  174. data/modules/apache/templates/mod/dir.conf.erb +1 -0
  175. data/modules/apache/templates/mod/disk_cache.conf.erb +8 -0
  176. data/modules/apache/templates/mod/event.conf.erb +9 -0
  177. data/modules/apache/templates/mod/fastcgi.conf.erb +6 -0
  178. data/modules/apache/templates/mod/info.conf.erb +6 -0
  179. data/modules/apache/templates/mod/itk.conf.erb +8 -0
  180. data/modules/apache/templates/mod/ldap.conf.erb +7 -0
  181. data/modules/apache/templates/mod/mime.conf.erb +36 -0
  182. data/modules/apache/templates/mod/mime_magic.conf.erb +1 -0
  183. data/modules/apache/templates/mod/mpm_event.conf.erb +9 -0
  184. data/modules/apache/templates/mod/negotiation.conf.erb +2 -0
  185. data/modules/apache/templates/mod/nss.conf.erb +228 -0
  186. data/modules/apache/templates/mod/passenger.conf.erb +30 -0
  187. data/modules/apache/templates/mod/peruser.conf.erb +12 -0
  188. data/modules/apache/templates/mod/php5.conf.erb +30 -0
  189. data/modules/apache/templates/mod/prefork.conf.erb +8 -0
  190. data/modules/apache/templates/mod/proxy.conf.erb +23 -0
  191. data/modules/apache/templates/mod/proxy_html.conf.erb +24 -0
  192. data/modules/apache/templates/mod/reqtimeout.conf.erb +2 -0
  193. data/modules/apache/templates/mod/rpaf.conf.erb +15 -0
  194. data/modules/apache/templates/mod/setenvif.conf.erb +34 -0
  195. data/modules/apache/templates/mod/ssl.conf.erb +24 -0
  196. data/modules/apache/templates/mod/status.conf.erb +12 -0
  197. data/modules/apache/templates/mod/suphp.conf.erb +19 -0
  198. data/modules/apache/templates/mod/userdir.conf.erb +19 -0
  199. data/modules/apache/templates/mod/worker.conf.erb +9 -0
  200. data/modules/apache/templates/mod/wsgi.conf.erb +13 -0
  201. data/modules/apache/templates/namevirtualhost.erb +8 -0
  202. data/modules/apache/templates/ports_header.erb +5 -0
  203. data/modules/apache/templates/vhost/_aliases.erb +12 -0
  204. data/modules/apache/templates/vhost/_block.erb +10 -0
  205. data/modules/apache/templates/vhost/_custom_fragment.erb +5 -0
  206. data/modules/apache/templates/vhost/_directories.erb +143 -0
  207. data/modules/apache/templates/vhost/_error_document.erb +7 -0
  208. data/modules/apache/templates/vhost/_fastcgi.erb +18 -0
  209. data/modules/apache/templates/vhost/_itk.erb +28 -0
  210. data/modules/apache/templates/vhost/_php_admin.erb +12 -0
  211. data/modules/apache/templates/vhost/_proxy.erb +20 -0
  212. data/modules/apache/templates/vhost/_rack.erb +7 -0
  213. data/modules/apache/templates/vhost/_redirect.erb +12 -0
  214. data/modules/apache/templates/vhost/_requestheader.erb +10 -0
  215. data/modules/apache/templates/vhost/_rewrite.erb +40 -0
  216. data/modules/apache/templates/vhost/_scriptalias.erb +24 -0
  217. data/modules/apache/templates/vhost/_serveralias.erb +7 -0
  218. data/modules/apache/templates/vhost/_setenv.erb +12 -0
  219. data/modules/apache/templates/vhost/_ssl.erb +41 -0
  220. data/modules/apache/templates/vhost/_suphp.erb +11 -0
  221. data/modules/apache/templates/vhost/_wsgi.erb +15 -0
  222. data/modules/apache/templates/vhost.conf.erb +63 -0
  223. data/modules/apache/tests/apache.pp +6 -0
  224. data/modules/apache/tests/dev.pp +1 -0
  225. data/modules/apache/tests/init.pp +1 -0
  226. data/modules/apache/tests/mod_load_params.pp +11 -0
  227. data/modules/apache/tests/mods.pp +9 -0
  228. data/modules/apache/tests/mods_custom.pp +16 -0
  229. data/modules/apache/tests/php.pp +4 -0
  230. data/modules/apache/tests/vhost.pp +237 -0
  231. data/modules/apache/tests/vhost_directories.pp +30 -0
  232. data/modules/apache/tests/vhost_ip_based.pp +25 -0
  233. data/modules/apache/tests/vhost_ssl.pp +23 -0
  234. data/modules/apache/tests/vhosts_without_listen.pp +53 -0
  235. data/modules/freighthop/manifests/database/mysql/grant.pp +11 -0
  236. data/modules/freighthop/manifests/database/mysql.pp +5 -15
  237. data/modules/freighthop/manifests/database/postgres.pp +2 -2
  238. data/modules/freighthop/manifests/database.pp +3 -3
  239. data/modules/freighthop/manifests/init.pp +6 -23
  240. data/modules/freighthop/manifests/language/ruby.pp +5 -25
  241. data/modules/freighthop/manifests/language.pp +1 -4
  242. data/modules/freighthop/manifests/packages.pp +2 -12
  243. data/modules/freighthop/manifests/params.pp +19 -11
  244. data/modules/freighthop/manifests/web/apache.pp +60 -0
  245. data/modules/freighthop/manifests/web/nginx.pp +22 -0
  246. data/modules/freighthop/manifests/web/ssl.pp +13 -0
  247. data/modules/freighthop/manifests/web.pp +25 -21
  248. data/modules/freighthop/templates/apache/passenger.conf.erb +18 -0
  249. data/modules/freighthop/templates/nginx/vagrant-rails.conf.erb +5 -3
  250. data/modules/rbenv/AUTHORS +11 -0
  251. data/modules/rbenv/CHANGELOG.md +70 -0
  252. data/modules/rbenv/Gemfile +5 -10
  253. data/modules/rbenv/Gemfile.lock +16 -58
  254. data/modules/rbenv/Modulefile +7 -7
  255. data/modules/rbenv/README.md +156 -20
  256. data/modules/rbenv/Rakefile +18 -24
  257. data/modules/rbenv/TODO +10 -0
  258. data/modules/rbenv/bin/autospec +16 -0
  259. data/modules/rbenv/bin/facter +16 -0
  260. data/modules/rbenv/bin/filebucket +16 -0
  261. data/modules/rbenv/bin/hiera +16 -0
  262. data/modules/rbenv/bin/htmldiff +16 -0
  263. data/modules/rbenv/bin/ldiff +16 -0
  264. data/modules/rbenv/bin/pi +16 -0
  265. data/modules/rbenv/bin/puppet +16 -0
  266. data/modules/rbenv/bin/puppet-lint +16 -0
  267. data/modules/rbenv/bin/puppet-module +16 -0
  268. data/modules/rbenv/bin/puppetca +16 -0
  269. data/modules/rbenv/bin/puppetd +16 -0
  270. data/modules/rbenv/bin/puppetdoc +16 -0
  271. data/modules/rbenv/bin/puppetmasterd +16 -0
  272. data/modules/rbenv/bin/puppetqd +16 -0
  273. data/modules/rbenv/bin/puppetrun +16 -0
  274. data/modules/rbenv/bin/rake +16 -0
  275. data/modules/rbenv/bin/ralsh +16 -0
  276. data/modules/rbenv/bin/rspec +16 -0
  277. data/modules/rbenv/bin/rspec-puppet-init +16 -0
  278. data/modules/rbenv/lib/puppet/provider/rbenvgem/default.rb +50 -0
  279. data/modules/rbenv/lib/puppet/type/rbenvgem.rb +62 -0
  280. data/modules/rbenv/manifests/bundle.pp +36 -0
  281. data/modules/rbenv/manifests/client.pp +48 -0
  282. data/modules/rbenv/manifests/compile.pp +102 -0
  283. data/modules/rbenv/manifests/definition.pp +31 -0
  284. data/modules/rbenv/manifests/dependencies/centos.pp +25 -0
  285. data/modules/rbenv/manifests/dependencies/suse.pp +28 -0
  286. data/modules/rbenv/manifests/dependencies/ubuntu.pp +17 -0
  287. data/modules/rbenv/manifests/dependencies.pp +8 -0
  288. data/modules/rbenv/manifests/gem.pp +29 -0
  289. data/modules/rbenv/manifests/install.pp +55 -0
  290. data/modules/rbenv/manifests/plugin/rbenvvars.pp +16 -0
  291. data/modules/rbenv/manifests/plugin/rubybuild.pp +16 -0
  292. data/modules/rbenv/manifests/plugin.pp +40 -0
  293. data/modules/rbenv/metadata.json +99 -31
  294. data/modules/rbenv/spec/classes/dependencies_spec.rb +20 -0
  295. data/modules/rbenv/spec/defines/rbenv__compile_spec.rb +34 -0
  296. data/modules/rbenv/spec/defines/rbenv__definition_spec.rb +40 -0
  297. data/modules/rbenv/spec/defines/rbenv__install_spec.rb +24 -0
  298. data/modules/rbenv/spec/defines/rbenv__plugin__rbenvvars_spec.rb +14 -0
  299. data/modules/rbenv/spec/defines/rbenv__plugin__rubybuild_spec.rb +14 -0
  300. data/modules/rbenv/spec/defines/rbenv__plugin_spec.rb +31 -0
  301. data/modules/rbenv/spec/fixtures/manifests/site.pp +0 -0
  302. data/modules/rbenv/spec/spec_helper.rb +6 -1
  303. data/modules/rbenv/templates/Gemfile.erb +5 -0
  304. data/modules/rbenv/templates/dot.rbenvrc.erb +8 -0
  305. metadata +271 -23
  306. data/modules/rbenv/CHANGELOG +0 -33
  307. data/modules/rbenv/LICENSE +0 -20
  308. data/modules/rbenv/manifests/alias.pp +0 -32
  309. data/modules/rbenv/manifests/global.pp +0 -22
  310. data/modules/rbenv/manifests/init.pp +0 -30
  311. data/modules/rbenv/manifests/params.pp +0 -16
  312. data/modules/rbenv/manifests/rehash.pp +0 -28
  313. data/modules/rbenv/manifests/version.pp +0 -63
  314. data/modules/rbenv/spec/classes/rbenv__global_spec.rb +0 -31
  315. data/modules/rbenv/spec/classes/rbenv_spec.rb +0 -30
  316. data/modules/rbenv/spec/defines/rbenv__alias_spec.rb +0 -22
  317. data/modules/rbenv/spec/defines/rbenv__rehash_spec.rb +0 -22
  318. data/modules/rbenv/spec/defines/rbenv__version_spec.rb +0 -60
  319. data/modules/rbenv/spec/spec_helper_system.rb +0 -16
  320. data/modules/rbenv/spec/system/basic_spec.rb +0 -13
  321. data/modules/rbenv/templates/etc/profile.d/rbenv.sh.erb +0 -2
  322. data/modules/rbenv/tests/init.pp +0 -12
@@ -0,0 +1,1515 @@
1
+ #apache
2
+
3
+ [![Build Status](https://travis-ci.org/puppetlabs/puppetlabs-apache.png?branch=master)](https://travis-ci.org/puppetlabs/puppetlabs-apache)
4
+
5
+ ####Table of Contents
6
+
7
+ 1. [Overview - What is the Apache module?](#overview)
8
+ 2. [Module Description - What does the module do?](#module-description)
9
+ 3. [Setup - The basics of getting started with Apache](#setup)
10
+ * [Beginning with Apache - Installation](#beginning-with-apache)
11
+ * [Configure a Virtual Host - Basic options for getting started](#configure-a-virtual-host)
12
+ 4. [Usage - The classes, defined types, and their parameters available for configuration](#usage)
13
+ * [Classes and Defined Types](#classes-and-defined-types)
14
+ * [Class: apache](#class-apache)
15
+ * [Classes: apache::mod::*](#classes-apachemodname)
16
+ * [Defined Type: apache::vhost](#defined-type-apachevhost)
17
+ * [Virtual Host Examples - Demonstrations of some configuration options](#virtual-host-examples)
18
+ 5. [Implementation - An under-the-hood peek at what the module is doing](#implementation)
19
+ * [Classes and Defined Types](#classes-and-defined-types)
20
+ * [Templates](#templates)
21
+ 6. [Limitations - OS compatibility, etc.](#limitations)
22
+ 7. [Development - Guide for contributing to the module](#development)
23
+ 8. [Release Notes - Notes on the most recent updates to the module](#release-notes)
24
+
25
+ ##Overview
26
+
27
+ The Apache module allows you to set up virtual hosts and manage web services with minimal effort.
28
+
29
+ ##Module Description
30
+
31
+ Apache is a widely-used web server, and this module provides a simplified way of creating configurations to manage your infrastructure. This includes the ability to configure and manage a range of different virtual host setups, as well as a streamlined way to install and configure Apache modules.
32
+
33
+ ##Setup
34
+
35
+ **What Apache affects:**
36
+
37
+ * configuration files and directories (created and written to)
38
+ * **NOTE**: Configurations that are *not* managed by Puppet will be purged.
39
+ * package/service/configuration files for Apache
40
+ * Apache modules
41
+ * virtual hosts
42
+ * listened-to ports
43
+ * `/etc/make.conf` on FreeBSD
44
+
45
+ ###Beginning with Apache
46
+
47
+ To install Apache with the default parameters
48
+
49
+ ```puppet
50
+ class { 'apache': }
51
+ ```
52
+
53
+ The defaults are determined by your operating system (e.g. Debian systems have one set of defaults, RedHat systems have another). These defaults will work well in a testing environment, but are not suggested for production. To establish customized parameters
54
+
55
+ ```puppet
56
+ class { 'apache':
57
+ default_mods => false,
58
+ default_confd_files => false,
59
+ }
60
+ ```
61
+
62
+ ###Configure a virtual host
63
+
64
+ Declaring the `apache` class will create a default virtual host by setting up a vhost on port 80, listening on all interfaces and serving `$apache::docroot`.
65
+
66
+ ```puppet
67
+ class { 'apache': }
68
+ ```
69
+
70
+ To configure a very basic, name-based virtual host
71
+
72
+ ```puppet
73
+ apache::vhost { 'first.example.com':
74
+ port => '80',
75
+ docroot => '/var/www/first',
76
+ }
77
+ ```
78
+
79
+ *Note:* The default priority is 15. If nothing matches this priority, the alphabetically first name-based vhost will be used. This is also true if you pass a higher priority and no names match anything else.
80
+
81
+ A slightly more complicated example, which moves the docroot owner/group
82
+
83
+ ```puppet
84
+ apache::vhost { 'second.example.com':
85
+ port => '80',
86
+ docroot => '/var/www/second',
87
+ docroot_owner => 'third',
88
+ docroot_group => 'third',
89
+ }
90
+ ```
91
+
92
+ To set up a virtual host with SSL and default SSL certificates
93
+
94
+ ```puppet
95
+ apache::vhost { 'ssl.example.com':
96
+ port => '443',
97
+ docroot => '/var/www/ssl',
98
+ ssl => true,
99
+ }
100
+ ```
101
+
102
+ To set up a virtual host with SSL and specific SSL certificates
103
+
104
+ ```puppet
105
+ apache::vhost { 'fourth.example.com':
106
+ port => '443',
107
+ docroot => '/var/www/fourth',
108
+ ssl => true,
109
+ ssl_cert => '/etc/ssl/fourth.example.com.cert',
110
+ ssl_key => '/etc/ssl/fourth.example.com.key',
111
+ }
112
+ ```
113
+
114
+ To set up a virtual host with IP address different than '*'
115
+
116
+ ```puppet
117
+ apache::vhost { 'subdomain.example.com':
118
+ ip => '127.0.0.1',
119
+ port => '80',
120
+ docrout => '/var/www/subdomain',
121
+ }
122
+ ```
123
+
124
+ To set up a virtual host with wildcard alias for subdomain mapped to same named directory
125
+ `http://examle.com.loc => /var/www/example.com`
126
+
127
+ ```puppet
128
+ apache::vhost { 'subdomain.loc':
129
+ vhost_name => '*',
130
+ port => '80',
131
+ virtual_docroot' => '/var/www/%-2+',
132
+ docroot => '/var/www',
133
+ serveraliases => ['*.loc',],
134
+ }
135
+ ```
136
+
137
+ To set up a virtual host with suPHP
138
+
139
+ ```puppet
140
+ apache::vhost { 'suphp.example.com':
141
+ port => '80',
142
+ docroot => '/home/appuser/myphpapp',
143
+ suphp_addhandler => 'x-httpd-php',
144
+ suphp_engine => 'on',
145
+ suphp_configpath => '/etc/php5/apache2',
146
+ directories => { path => '/home/appuser/myphpapp',
147
+ 'suphp' => { user => 'myappuser', group => 'myappgroup' },
148
+ }
149
+ }
150
+ ```
151
+
152
+ To set up a virtual host with WSGI
153
+
154
+ ```puppet
155
+ apache::vhost { 'wsgi.example.com':
156
+ port => '80',
157
+ docroot => '/var/www/pythonapp',
158
+ wsgi_daemon_process => 'wsgi',
159
+ wsgi_daemon_process_options =>
160
+ { processes => '2', threads => '15', display-name => '%{GROUP}' },
161
+ wsgi_process_group => 'wsgi',
162
+ wsgi_script_aliases => { '/' => '/var/www/demo.wsgi' },
163
+ }
164
+ ```
165
+
166
+ Starting 2.2.16, httpd supports [FallbackResource](https://httpd.apache.org/docs/2.2/mod/mod_dir.html#fallbackresource) which is a simple replace for common RewriteRules:
167
+
168
+ ```puppet
169
+ apache::vhost { 'wordpress.example.com':
170
+ port => '80',
171
+ docroot => '/var/www/wordpress',
172
+ fallbackresource => '/index.php',
173
+ }
174
+ ```
175
+
176
+ Please note that the `disabled` argument to FallbackResource is only supported since 2.2.24.
177
+
178
+ To see a list of all virtual host parameters, [please go here](#defined-type-apachevhost). To see an extensive list of virtual host examples [please look here](#virtual-host-examples).
179
+
180
+ ##Usage
181
+
182
+ ###Classes and Defined Types
183
+
184
+ This module modifies Apache configuration files and directories and will purge any configuration not managed by Puppet. Configuration of Apache should be managed by Puppet, as non-puppet configuration files can cause unexpected failures.
185
+
186
+ It is possible to temporarily disable full Puppet management by setting the `purge_configs` parameter within the base `apache` class to 'false'. This option should only be used as a temporary means of saving and relocating customized configurations.
187
+
188
+ ####Class: `apache`
189
+
190
+ The Apache module's primary class, `apache`, guides the basic setup of Apache on your system.
191
+
192
+ You may establish a default vhost in this class, the `vhost` class, or both. You may add additional vhost configurations for specific virtual hosts using a declaration of the `vhost` type.
193
+
194
+ **Parameters within `apache`:**
195
+
196
+ #####`default_mods`
197
+
198
+ Sets up Apache with default settings based on your OS. Defaults to 'true', set to 'false' for customized configuration.
199
+
200
+ #####`default_vhost`
201
+
202
+ Sets up a default virtual host. Defaults to 'true', set to 'false' to set up [customized virtual hosts](#configure-a-virtual-host).
203
+
204
+ #####`default_confd_files`
205
+
206
+ Generates default set of include-able apache configuration files under `${apache::confd_dir}` directory. These configuration files correspond to what is usually installed with apache package on given platform.
207
+
208
+ #####`default_ssl_vhost`
209
+
210
+ Sets up a default SSL virtual host. Defaults to 'false'.
211
+
212
+ ```puppet
213
+ apache::vhost { 'default-ssl':
214
+ port => 443,
215
+ ssl => true,
216
+ docroot => $docroot,
217
+ scriptalias => $scriptalias,
218
+ serveradmin => $serveradmin,
219
+ access_log_file => "ssl_${access_log_file}",
220
+ }
221
+ ```
222
+
223
+ SSL vhosts only respond to HTTPS queries.
224
+
225
+ #####`default_ssl_cert`
226
+
227
+ The default SSL certification, which is automatically set based on your operating system (`/etc/pki/tls/certs/localhost.crt` for RedHat, `/etc/ssl/certs/ssl-cert-snakeoil.pem` for Debian, `/usr/local/etc/apache22/server.crt` for FreeBSD). This default will work out of the box but must be updated with your specific certificate information before being used in production.
228
+
229
+ #####`default_ssl_key`
230
+
231
+ The default SSL key, which is automatically set based on your operating system (`/etc/pki/tls/private/localhost.key` for RedHat, `/etc/ssl/private/ssl-cert-snakeoil.key` for Debian, `/usr/local/etc/apache22/server.key` for FreeBSD). This default will work out of the box but must be updated with your specific certificate information before being used in production.
232
+
233
+ #####`default_ssl_chain`
234
+
235
+ The default SSL chain, which is automatically set to 'undef'. This default will work out of the box but must be updated with your specific certificate information before being used in production.
236
+
237
+ #####`default_ssl_ca`
238
+
239
+ The default certificate authority, which is automatically set to 'undef'. This default will work out of the box but must be updated with your specific certificate information before being used in production.
240
+
241
+ #####`default_ssl_crl_path`
242
+
243
+ The default certificate revocation list path, which is automatically set to 'undef'. This default will work out of the box but must be updated with your specific certificate information before being used in production.
244
+
245
+ #####`default_ssl_crl`
246
+
247
+ The default certificate revocation list to use, which is automatically set to 'undef'. This default will work out of the box but must be updated with your specific certificate information before being used in production.
248
+
249
+ #####`service_name`
250
+
251
+ Name of apache service to run. Defaults to: `'httpd'` on RedHat, `'apache2'` on Debian, and `'apache22'` on FreeBSD.
252
+
253
+ #####`service_enable`
254
+
255
+ Determines whether the 'httpd' service is enabled when the machine is booted. Defaults to 'true'.
256
+
257
+ #####`service_ensure`
258
+
259
+ Determines whether the service should be running. Can be set to 'undef' which is useful when you want to let the service be managed by some other application like pacemaker. Defaults to 'running'.
260
+
261
+ #####`purge_configs`
262
+
263
+ Removes all other apache configs and vhosts, which is automatically set to true. Setting this to false is a stopgap measure to allow the apache module to coexist with existing or otherwise managed configuration. It is recommended that you move your configuration entirely to resources within this module.
264
+
265
+ #####`serveradmin`
266
+
267
+ Sets the server administrator. Defaults to 'root@localhost'.
268
+
269
+ #####`servername`
270
+
271
+ Sets the servername. Defaults to fqdn provided by facter.
272
+
273
+ #####`server_root`
274
+
275
+ A value to be set as `ServerRoot` in main configuration file (`httpd.conf`). Defaults to `/etc/httpd` on RedHat, `/etc/apache2` on Debian and `/usr/local` on FreeBSD.
276
+
277
+ #####`sendfile`
278
+
279
+ Makes Apache use the Linux kernel 'sendfile' to serve static files. Defaults to 'On'.
280
+
281
+ #####`server_root`
282
+
283
+ A value to be set as `ServerRoot` in main configuration file (`httpd.conf`). Defaults to `/etc/httpd` on RedHat and `/etc/apache2` on Debian.
284
+
285
+ #####`error_documents`
286
+
287
+ Enables custom error documents. Defaults to 'false'.
288
+
289
+ #####`httpd_dir`
290
+
291
+ Changes the base location of the configuration directories used for the service. This is useful for specially repackaged HTTPD builds but may have unintended consequences when used in combination with the default distribution packages. Default is based on your OS.
292
+
293
+ #####`confd_dir`
294
+
295
+ Changes the location of the configuration directory your custom configuration files are placed in. Default is based on your OS.
296
+
297
+ #####`vhost_dir`
298
+
299
+ Changes the location of the configuration directory your virtual host configuration files are placed in. Default is based on your OS.
300
+
301
+ #####`mod_dir`
302
+
303
+ Changes the location of the configuration directory your Apache modules configuration files are placed in. Default is based on your OS.
304
+
305
+ #####`mpm_module`
306
+
307
+ Configures which mpm module is loaded and configured for the httpd process by the `apache::mod::event`, `apache::mod::itk`, `apache::mod::peruser`, `apache::mod::prefork` and `apache::mod::worker` classes. Must be set to `false` to explicitly declare `apache::mod::event`, `apache::mod::itk`, `apache::mod::peruser`, `apache::mod::prefork` or `apache::mod::worker` classes with parameters. All possible values are `event`, `itk`, `peruser`, `prefork`, `worker` (valid values depend on agent's OS), or the boolean `false`. Defaults to `prefork` on RedHat and FreeBSD and `worker` on Debian. Note: on FreeBSD switching between different mpm modules is quite difficult (but possible). Before changing `$mpm_module` one has to deinstall all packages that depend on currently installed `apache`.
308
+
309
+ #####`conf_template`
310
+
311
+ Setting this allows you to override the template used for the main apache configuration file. This is a potentially risky thing to do as this module has been built around the concept of a minimal configuration file with most of the configuration coming in the form of conf.d/ entries. Defaults to 'apache/httpd.conf.erb'.
312
+
313
+ #####`keepalive`
314
+
315
+ Setting this allows you to enable persistent connections.
316
+
317
+ #####`keepalive_timeout`
318
+
319
+ Amount of time the server will wait for subsequent requests on a persistent connection. Defaults to '15'.
320
+
321
+ #####`logroot`
322
+
323
+ Changes the location of the directory Apache log files are placed in. Defaut is based on your OS.
324
+
325
+ #####`log_level`
326
+
327
+ Changes the verbosity level of the error log. Defaults to 'warn'. Valid values are `emerg`, `alert`, `crit`, `error`, `warn`, `notice`, `info` or `debug`.
328
+
329
+ #####`ports_file`
330
+
331
+ Changes the name of the file containing Apache ports configuration. Default is `${conf_dir}/ports.conf`.
332
+
333
+ #####`server_tokens`
334
+
335
+ Controls how much information Apache sends to the browser about itself and the operating system. See Apache documentation for 'ServerTokens'. Defaults to 'OS'.
336
+
337
+ #####`server_signature`
338
+
339
+ Allows the configuration of a trailing footer line under server-generated documents. See Apache documentation for 'ServerSignature'. Defaults to 'On'.
340
+
341
+ #####`trace_enable`
342
+
343
+ Controls, how TRACE requests per RFC 2616 are handled. See Apache documentation for 'TraceEnable'. Defaults to 'On'.
344
+
345
+ #####`manage_user`
346
+
347
+ Setting this to false will avoid the user resource to be created by this module. This is useful when you already have a user created in another puppet module and that you want to used it to run apache. Without this, it would result in a duplicate resource error.
348
+
349
+ #####`manage_group`
350
+
351
+ Setting this to false will avoid the group resource to be created by this module. This is useful when you already have a group created in another puppet module and that you want to used it for apache. Without this, it would result in a duplicate resource error.
352
+
353
+ #####`package_ensure`
354
+
355
+ Allow control over the package ensure statement. This is useful if you want to make sure apache is always at the latest version or whether it is only installed.
356
+
357
+ ####Class: `apache::default_mods`
358
+
359
+ Installs default Apache modules based on what OS you are running
360
+
361
+ ```puppet
362
+ class { 'apache::default_mods': }
363
+ ```
364
+
365
+ ####Defined Type: `apache::mod`
366
+
367
+ Used to enable arbitrary Apache httpd modules for which there is no specific `apache::mod::[name]` class. The `apache::mod` defined type will also install the required packages to enable the module, if any.
368
+
369
+ ```puppet
370
+ apache::mod { 'rewrite': }
371
+ apache::mod { 'ldap': }
372
+ ```
373
+
374
+ ####Classes: `apache::mod::[name]`
375
+
376
+ There are many `apache::mod::[name]` classes within this module that can be declared using `include`:
377
+
378
+ * `alias`
379
+ * `auth_basic`
380
+ * `auth_kerb`
381
+ * `autoindex`
382
+ * `cache`
383
+ * `cgi`
384
+ * `cgid`
385
+ * `dav`
386
+ * `dav_fs`
387
+ * `dav_svn`
388
+ * `deflate`
389
+ * `dev`
390
+ * `dir`*
391
+ * `disk_cache`
392
+ * `event`
393
+ * `fastcgi`
394
+ * `fcgid`
395
+ * `headers`
396
+ * `include`
397
+ * `info`
398
+ * `itk`
399
+ * `ldap`
400
+ * `mime`
401
+ * `mime_magic`*
402
+ * `mpm_event`
403
+ * `negotiation`
404
+ * `nss`*
405
+ * `passenger`*
406
+ * `perl`
407
+ * `peruser`
408
+ * `php` (requires [`mpm_module`](#mpm_module) set to `prefork`)
409
+ * `prefork`*
410
+ * `proxy`*
411
+ * `proxy_ajp`
412
+ * `proxy_html`
413
+ * `proxy_http`
414
+ * `python`
415
+ * `reqtimeout`
416
+ * `rewrite`
417
+ * `rpaf`*
418
+ * `setenvif`
419
+ * `ssl`* (see [apache::mod::ssl](#class-apachemodssl) below)
420
+ * `status`*
421
+ * `suphp`
422
+ * `userdir`*
423
+ * `vhost_alias`
424
+ * `worker`*
425
+ * `wsgi` (see [apache::mod::wsgi](#class-apachemodwsgi) below)
426
+ * `xsendfile`
427
+
428
+ Modules noted with a * indicate that the module has settings and, thus, a template that includes parameters. These parameters control the module's configuration. Most of the time, these parameters will not require any configuration or attention.
429
+
430
+ The modules mentioned above, and other Apache modules that have templates, will cause template files to be dropped along with the mod install, and the module will not work without the template. Any mod without a template will install package but drop no files.
431
+
432
+ ####Class: `apache::mod::ssl`
433
+
434
+ Installs Apache SSL capabilities and utilizes `ssl.conf.erb` template. These are the defaults:
435
+
436
+ ```puppet
437
+ class { 'apache::mod::ssl':
438
+ ssl_compression => false,
439
+ ssl_options => [ 'StdEnvVars' ],
440
+ }
441
+ ```
442
+
443
+ To *use* SSL with a virtual host, you must either set the`default_ssl_vhost` parameter in `apache` to 'true' or set the `ssl` parameter in `apache::vhost` to 'true'.
444
+
445
+ ####Class: `apache::mod::wsgi`
446
+
447
+ ```puppet
448
+ class { 'apache::mod::wsgi':
449
+ wsgi_socket_prefix => "\${APACHE_RUN_DIR}WSGI",
450
+ wsgi_python_home => '/path/to/virtenv',
451
+ wsgi_python_path => '/path/to/virtenv/site-packages',
452
+ }
453
+ ```
454
+ ####Defined Type: `apache::vhost`
455
+
456
+ The Apache module allows a lot of flexibility in the set up and configuration of virtual hosts. This flexibility is due, in part, to `vhost`'s setup as a defined resource type, which allows it to be evaluated multiple times with different parameters.
457
+
458
+ The `vhost` defined type allows you to have specialized configurations for virtual hosts that have requirements outside of the defaults. You can set up a default vhost within the base `apache` class as well as set a customized vhost setup as default. Your customized vhost (priority 10) will be privileged over the base class vhost (15).
459
+
460
+ If you have a series of specific configurations and do not want a base `apache` class default vhost, make sure to set the base class default host to 'false'.
461
+
462
+ ```puppet
463
+ class { 'apache':
464
+ default_vhost => false,
465
+ }
466
+ ```
467
+
468
+ **Parameters within `apache::vhost`:**
469
+
470
+ The default values for each parameter will vary based on operating system and type of virtual host.
471
+
472
+ #####`access_log`
473
+
474
+ Specifies whether `*_access.log` directives should be configured. Valid values are 'true' and 'false'. Defaults to 'true'.
475
+
476
+ #####`access_log_file`
477
+
478
+ Points to the `*_access.log` file. Defaults to 'undef'.
479
+
480
+ #####`access_log_pipe`
481
+
482
+ Specifies a pipe to send access log messages to. Defaults to 'undef'.
483
+
484
+ #####`access_log_syslog`
485
+
486
+ Sends all access log messages to syslog. Defaults to 'undef'.
487
+
488
+ #####`access_log_format`
489
+
490
+ Specifies either a LogFormat nickname or custom format string for access log. Defaults to 'undef'.
491
+
492
+ #####`access_log_env_var`
493
+
494
+ Adds writing control of access log via environment variable of the access. Defaults to 'undef'.
495
+
496
+ #####`add_listen`
497
+
498
+ Determines whether the vhost creates a listen statement. The default value is 'true'.
499
+
500
+ Setting `add_listen` to 'false' stops the vhost from creating a listen statement, and this is important when you combine vhosts that are not passed an `ip` parameter with vhosts that *are* passed the `ip` parameter.
501
+
502
+ #####`aliases`
503
+
504
+ Passes a list of hashes to the vhost to create `Alias` or `AliasMatch` statements as per the [`mod_alias` documentation](http://httpd.apache.org/docs/current/mod/mod_alias.html). Each hash is expected to be of the form:
505
+
506
+ ```
507
+ aliases => [
508
+ { aliasmatch => '^/image/(.*)\.jpg$', path => '/files/jpg.images/$1.jpg' }
509
+ { alias => '/image', path => '/ftp/pub/image' },
510
+ ],
511
+ ```
512
+
513
+ For `Alias` and `AliasMatch` to work, each will need a corresponding `<Directory /path/to/directory>` or `<Location /path/to/directory>` block. The `Alias` and `AliasMatch` directives are created in the order specified in the `aliases` paramter. As described in the [`mod_alias` documentation](http://httpd.apache.org/docs/current/mod/mod_alias.html) more specific `Alias` or `AliasMatch` directives should come before the more general ones to avoid shadowing.
514
+
515
+ **Note:** If `apache::mod::passenger` is loaded and `PassengerHighPerformance true` is set, then `Alias` may have issues honouring the `PassengerEnabled off` statement. See [this article](http://www.conandalton.net/2010/06/passengerenabled-off-not-working.html) for details.
516
+
517
+ #####`block`
518
+
519
+ Specifies the list of things Apache will block access to. The default is an empty set, '[]'. Currently, the only option is 'scm', which blocks web access to .svn, .git and .bzr directories. To add to this, please see the [Development](#development) section.
520
+
521
+ #####`custom_fragment`
522
+
523
+ Pass a string of custom configuration directives to be placed at the end of the vhost configuration.
524
+
525
+ #####`default_vhost`
526
+
527
+ Sets a given `apache::vhost` as the default to serve requests that do not match any other `apache::vhost` definitions. The default value is 'false'.
528
+
529
+ #####`directories`
530
+
531
+ Passes a list of hashes to the vhost to create `<Directory /path/to/directory>...</Directory>` directive blocks as per the [Apache core documentation](http://httpd.apache.org/docs/2.2/mod/core.html#directory). The `path` key is required in these hashes. An optional `provider` defaults to `directory`. Usage will typically look like:
532
+
533
+ ```puppet
534
+ apache::vhost { 'sample.example.net':
535
+ docroot => '/path/to/directory',
536
+ directories => [
537
+ { path => '/path/to/directory', <directive> => <value> },
538
+ { path => '/path/to/another/directory', <directive> => <value> },
539
+ ],
540
+ }
541
+ ```
542
+
543
+ *Note:* At least one directory should match `docroot` parameter, once you start declaring directories `apache::vhost` assumes that all required `<Directory>` blocks will be declared.
544
+
545
+ *Note:* If not defined a single default `<Directory>` block will be created that matches the `docroot` parameter.
546
+
547
+ `provider` can be set to any of `directory`, `files`, or `location`. If the [pathspec starts with a `~`](https://httpd.apache.org/docs/2.2/mod/core.html#files), httpd will interpret this as the equivalent of `DirectoryMatch`, `FilesMatch`, or `LocationMatch`, respectively.
548
+
549
+ ```puppet
550
+ apache::vhost { 'files.example.net':
551
+ docroot => '/var/www/files',
552
+ directories => [
553
+ { path => '~ (\.swp|\.bak|~)$', 'provider' => 'files', 'deny' => 'from all' },
554
+ ],
555
+ }
556
+ ```
557
+
558
+ The directives will be embedded within the `Directory` (`Files`, or `Location`) directive block, missing directives should be undefined and not be added, resulting in their default vaules in Apache. Currently this is the list of supported directives:
559
+
560
+ ######`addhandlers`
561
+
562
+ Sets `AddHandler` directives as per the [Apache Core documentation](http://httpd.apache.org/docs/2.2/mod/mod_mime.html#addhandler). Accepts a list of hashes of the form `{ handler => 'handler-name', extensions => ['extension']}`. Note that `extensions` is a list of extenstions being handled by the handler.
563
+ An example:
564
+
565
+ ```puppet
566
+ apache::vhost { 'sample.example.net':
567
+ docroot => '/path/to/directory',
568
+ directories => [ { path => '/path/to/directory',
569
+ addhandlers => [ { handler => 'cgi-script', extensions => ['.cgi']} ],
570
+ } ],
571
+ }
572
+ ```
573
+
574
+ ######`allow`
575
+
576
+ Sets an `Allow` directive as per the [Apache Core documentation](http://httpd.apache.org/docs/2.2/mod/mod_authz_host.html#allow). An example:
577
+
578
+ ```puppet
579
+ apache::vhost { 'sample.example.net':
580
+ docroot => '/path/to/directory',
581
+ directories => [ { path => '/path/to/directory', allow => 'from example.org' } ],
582
+ }
583
+ ```
584
+
585
+ ######`allow_override`
586
+
587
+ Sets the usage of `.htaccess` files as per the [Apache core documentation](http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride). Should accept in the form of a list or a string. An example:
588
+
589
+ ```puppet
590
+ apache::vhost { 'sample.example.net':
591
+ docroot => '/path/to/directory',
592
+ directories => [ { path => '/path/to/directory', allow_override => ['AuthConfig', 'Indexes'] } ],
593
+ }
594
+ ```
595
+
596
+ ######`deny`
597
+
598
+ Sets an `Deny` directive as per the [Apache Core documentation](http://httpd.apache.org/docs/2.2/mod/mod_authz_host.html#deny). An example:
599
+
600
+ ```puppet
601
+ apache::vhost { 'sample.example.net':
602
+ docroot => '/path/to/directory',
603
+ directories => [ { path => '/path/to/directory', deny => 'from example.org' } ],
604
+ }
605
+ ```
606
+ ######`error_documents`
607
+
608
+ A list of hashes which can be used to override the [ErrorDocument](https://httpd.apache.org/docs/2.2/mod/core.html#errordocument) settings for this directory. Example:
609
+
610
+ ```puppet
611
+ apache::vhost { 'sample.example.net':
612
+ directories => [ { path => '/srv/www'
613
+ error_documents => [
614
+ { 'error_code' => '503', 'document' => '/service-unavail' },
615
+ ],
616
+ }]
617
+ }
618
+ ```
619
+
620
+ ######`headers`
621
+
622
+ Adds lines for `Header` directives as per the [Apache Header documentation](http://httpd.apache.org/docs/2.2/mod/mod_headers.html#header). An example:
623
+
624
+ ```puppet
625
+ apache::vhost { 'sample.example.net':
626
+ docroot => '/path/to/directory',
627
+ directories => {
628
+ path => '/path/to/directory',
629
+ headers => 'Set X-Robots-Tag "noindex, noarchive, nosnippet"',
630
+ },
631
+ }
632
+ ```
633
+
634
+ ######`options`
635
+
636
+ Lists the options for the given `<Directory>` block
637
+
638
+ ```puppet
639
+ apache::vhost { 'sample.example.net':
640
+ docroot => '/path/to/directory',
641
+ directories => [ { path => '/path/to/directory', options => ['Indexes','FollowSymLinks','MultiViews'] }],
642
+ }
643
+ ```
644
+
645
+ ######`index_options`
646
+
647
+ Styles the list
648
+
649
+ ```puppet
650
+ apache::vhost { 'sample.example.net':
651
+ docroot => '/path/to/directory',
652
+ directories => [ { path => '/path/to/directory', options => ['Indexes','FollowSymLinks','MultiViews'], index_options => ['IgnoreCase', 'FancyIndexing', 'FoldersFirst', 'NameWidth=*', 'DescriptionWidth=*', 'SuppressHTMLPreamble'] }],
653
+ }
654
+ ```
655
+
656
+ ######`index_order_default`
657
+ Sets the order of the list
658
+
659
+ ```puppet
660
+ apache::vhost { 'sample.example.net':
661
+ docroot => '/path/to/directory',
662
+ directories => [ { path => '/path/to/directory', order => 'Allow,Deny', index_order_default => ['Descending', 'Date']}, ],
663
+ }
664
+ ```
665
+
666
+ ######`order`
667
+ Sets the order of processing `Allow` and `Deny` statements as per [Apache core documentation](http://httpd.apache.org/docs/2.2/mod/mod_authz_host.html#order). An example:
668
+
669
+ ```puppet
670
+ apache::vhost { 'sample.example.net':
671
+ docroot => '/path/to/directory',
672
+ directories => [ { path => '/path/to/directory', order => 'Allow,Deny' } ],
673
+ }
674
+ ```
675
+
676
+ ######`auth_type`
677
+
678
+ Sets the value for `AuthType` as per the [Apache AuthType
679
+ documentation](https://httpd.apache.org/docs/2.2/mod/core.html#authtype).
680
+
681
+ ######`auth_name`
682
+
683
+ Sets the value for `AuthName` as per the [Apache AuthName
684
+ documentation](https://httpd.apache.org/docs/2.2/mod/core.html#authname).
685
+
686
+ ######`auth_digest_algorithm`
687
+
688
+ Sets the value for `AuthDigestAlgorithm` as per the [Apache
689
+ AuthDigestAlgorithm
690
+ documentation](https://httpd.apache.org/docs/2.2/mod/mod_auth_digest.html#authdigestalgorithm)
691
+
692
+ ######`auth_digest_domain`
693
+
694
+ Sets the value for `AuthDigestDomain` as per the [Apache AuthDigestDomain
695
+ documentation](https://httpd.apache.org/docs/2.2/mod/mod_auth_digest.html#authdigestdomain).
696
+
697
+ ######`auth_digest_nonce_lifetime`
698
+
699
+ Sets the value for `AuthDigestNonceLifetime` as per the [Apache
700
+ AuthDigestNonceLifetime
701
+ documentation](https://httpd.apache.org/docs/2.2/mod/mod_auth_digest.html#authdigestnoncelifetime)
702
+
703
+ ######`auth_digest_provider`
704
+
705
+ Sets the value for `AuthDigestProvider` as per the [Apache AuthDigestProvider
706
+ documentation](https://httpd.apache.org/docs/2.2/mod/mod_auth_digest.html#authdigestprovider).
707
+
708
+ ######`auth_digest_qop`
709
+
710
+ Sets the value for `AuthDigestQop` as per the [Apache AuthDigestQop
711
+ documentation](https://httpd.apache.org/docs/2.2/mod/mod_auth_digest.html#authdigestqop).
712
+
713
+ ######`auth_digest_shmem_size`
714
+
715
+ Sets the value for `AuthAuthDigestShmemSize` as per the [Apache AuthDigestShmemSize
716
+ documentation](https://httpd.apache.org/docs/2.2/mod/mod_auth_digest.html#authdigestshmemsize).
717
+
718
+ ######`auth_basic_authoritative`
719
+
720
+ Sets the value for `AuthBasicAuthoritative` as per the [Apache
721
+ AuthBasicAuthoritative
722
+ documentation](https://httpd.apache.org/docs/2.2/mod/mod_auth_basic.html#authbasicauthoritative).
723
+
724
+ ######`auth_basic_fake`
725
+
726
+ Sets the value for `AuthBasicFake` as per the [Apache AuthBasicFake
727
+ documentation](https://httpd.apache.org/docs/trunk/mod/mod_auth_basic.html#authbasicfake).
728
+
729
+ ######`auth_basic_provider`
730
+
731
+ Sets the value for `AuthBasicProvider` as per the [Apache AuthBasicProvider
732
+ documentation](https://httpd.apache.org/docs/2.2/mod/mod_auth_basic.html#authbasicprovider).
733
+
734
+ ######`auth_user_file`
735
+
736
+ Sets the value for `AuthUserFile` as per the [Apache AuthUserFile
737
+ documentation](https://httpd.apache.org/docs/2.2/mod/mod_authn_file.html#authuserfile).
738
+
739
+ ######`auth_require`
740
+
741
+ Sets the value for `AuthName` as per the [Apache Require
742
+ documentation](https://httpd.apache.org/docs/2.2/mod/core.html#require)
743
+
744
+
745
+ ######`passenger_enabled`
746
+
747
+ Sets the value for the `PassengerEnabled` directory to `on` or `off` as per the [Passenger documentation](http://www.modrails.com/documentation/Users%20guide%20Apache.html#PassengerEnabled).
748
+
749
+ ```puppet
750
+ apache::vhost { 'sample.example.net':
751
+ docroot => '/path/to/directory',
752
+ directories => [ { path => '/path/to/directory', passenger_enabled => 'off' } ],
753
+ }
754
+ ```
755
+
756
+ **Note:** This directive requires `apache::mod::passenger` to be active, Apache may not start with an unrecognised directive without it.
757
+
758
+ **Note:** Be aware that there is an [issue](http://www.conandalton.net/2010/06/passengerenabled-off-not-working.html) using the `PassengerEnabled` directive with the `PassengerHighPerformance` directive.
759
+
760
+ ######`ssl_options`
761
+
762
+ String or list of [`SSLOptions`](https://httpd.apache.org/docs/2.2/mod/mod_ssl.html#ssloptions) for the given `<Directory>` block. This overrides, or refines the [`SSLOptions`](https://httpd.apache.org/docs/2.2/mod/mod_ssl.html#ssloptions) of the parent block (either vhost, or server).
763
+
764
+ ```puppet
765
+ apache::vhost { 'secure.example.net':
766
+ docroot => '/path/to/directory',
767
+ directories => [
768
+ { path => '/path/to/directory', ssl_options => '+ExportCertData' }
769
+ { path => '/path/to/different/dir', ssl_options => [ '-StdEnvVars', '+ExportCertData'] },
770
+ ],
771
+ }
772
+ ```
773
+
774
+ ######`suphp`
775
+
776
+ An array containing two values: User and group for the [suPHP_UserGroup](http://www.suphp.org/DocumentationView.html?file=apache/CONFIG) setting.
777
+ This directive must be used with `suphp_engine => on` in the vhost declaration. This directive only works in `<Directory>` or `<Location>`.
778
+
779
+ ```puppet
780
+ apache::vhost { 'secure.example.net':
781
+ docroot => '/path/to/directory',
782
+ directories => [
783
+ { path => '/path/to/directory', suphp => { user => 'myappuser', group => 'myappgroup' }
784
+ ],
785
+ }
786
+ ```
787
+
788
+ ######`php_admin_value` and `php_admin_flag`
789
+
790
+ Allows per-vhost (and per-directory) setting [`php_admin_value`s or `php_admin_flag`s](http://php.net/manual/en/configuration.changes.php). These flags or values cannot be overwritten by a user, or an application.
791
+
792
+ ######`custom_fragment`
793
+
794
+ Pass a string of custom configuration directives to be placed at the end of the
795
+ directory configuration.
796
+
797
+ #####`directoryindex`
798
+
799
+ Set a DirectoryIndex directive, to set the list of resources to look for, when the client requests an index of the directory by specifying a / at the end of the directory name..
800
+
801
+ #####`docroot`
802
+
803
+ Provides the DocumentRoot directive, identifying the directory Apache serves files from.
804
+
805
+ #####`docroot_group`
806
+
807
+ Sets group access to the docroot directory. Defaults to 'root'.
808
+
809
+ #####`docroot_owner`
810
+
811
+ Sets individual user access to the docroot directory. Defaults to 'root'.
812
+
813
+ #####`error_log`
814
+
815
+ Specifies whether `*_error.log` directives should be configured. Defaults to 'true'.
816
+
817
+ #####`error_log_file`
818
+
819
+ Points to the `*_error.log` file. Defaults to 'undef'.
820
+
821
+ #####`error_log_pipe`
822
+
823
+ Specifies a pipe to send error log messages to. Defaults to 'undef'.
824
+
825
+ #####`error_log_syslog`
826
+
827
+ Sends all error log messages to syslog. Defaults to 'undef'.
828
+
829
+ #####`error_documents`
830
+
831
+ A list of hashes which can be used to override the [ErrorDocument](https://httpd.apache.org/docs/2.2/mod/core.html#errordocument) settings for this vhost. Defaults to `[]`. Example:
832
+
833
+ ```puppet
834
+ apache::vhost { 'sample.example.net':
835
+ error_documents => [
836
+ { 'error_code' => '503', 'document' => '/service-unavail' },
837
+ { 'error_code' => '407', 'document' => 'https://example.com/proxy/login' },
838
+ ],
839
+ }
840
+ ```
841
+
842
+ #####`ensure`
843
+
844
+ Specifies if the vhost file is present or absent.
845
+
846
+ #####`fastcgi_server`
847
+
848
+ Specifies the filename as an external FastCGI application. Defaults to 'undef'.
849
+
850
+ #####`fastcgi_socket`
851
+
852
+ Filename used to communicate with the web server. Defaults to 'undef'.
853
+
854
+ #####`fastcgi_dir`
855
+
856
+ Directory to enable for FastCGI. Defaults to 'undef'.
857
+
858
+ #####`additional_includes`
859
+
860
+ Specifies paths to additional static vhost-specific Apache configuration files.
861
+ This option is useful when you need to implement a unique and/or custom
862
+ configuration not supported by this module.
863
+
864
+ #####`ip`
865
+
866
+ The IP address the vhost listens on. Defaults to 'undef'.
867
+
868
+ #####`ip_based`
869
+
870
+ Enables an IP-based vhost. This parameter inhibits the creation of a NameVirtualHost directive, since those are used to funnel requests to name-based vhosts. Defaults to 'false'.
871
+
872
+ #####`logroot`
873
+
874
+ Specifies the location of the virtual host's logfiles. Defaults to `/var/log/<apache log location>/`.
875
+
876
+ #####`log_level`
877
+
878
+ Specifies the verbosity level of the error log. Defaults to `warn` for the global server configuration and can be overridden on a per-vhost basis using this parameter. Valid value for `log_level` is one of `emerg`, `alert`, `crit`, `error`, `warn`, `notice`, `info` or `debug`.
879
+
880
+ #####`no_proxy_uris`
881
+
882
+ Specifies URLs you do not want to proxy. This parameter is meant to be used in combination with `proxy_dest`.
883
+
884
+ #####`options`
885
+
886
+ Lists the options for the given virtual host
887
+
888
+ ```puppet
889
+ apache::vhost { 'site.name.fdqn':
890
+
891
+ options => ['Indexes','FollowSymLinks','MultiViews'],
892
+ }
893
+ ```
894
+
895
+ #####`override`
896
+
897
+ Sets the overrides for the given virtual host. Accepts an array of AllowOverride arguments.
898
+
899
+ #####`port`
900
+
901
+ Sets the port the host is configured on.
902
+
903
+ #####`priority`
904
+
905
+ Sets the relative load-order for Apache httpd VirtualHost configuration files. Defaults to '25'.
906
+
907
+ If nothing matches the priority, the first name-based vhost will be used. Likewise, passing a higher priority will cause the alphabetically first name-based vhost to be used if no other names match.
908
+
909
+ *Note*: You should not need to use this parameter. However, if you do use it, be aware that the `default_vhost` parameter for `apache::vhost` passes a priority of '15'.
910
+
911
+ #####`proxy_dest`
912
+
913
+ Specifies the destination address of a proxypass configuration. Defaults to 'undef'.
914
+
915
+ #####`proxy_pass`
916
+
917
+ Specifies an array of path => uri for a proxypass configuration. Defaults to 'undef'.
918
+
919
+ Example:
920
+
921
+ ```puppet
922
+ $proxy_pass = [
923
+ { 'path' => '/a', 'url' => 'http://backend-a/' },
924
+ { 'path' => '/b', 'url' => 'http://backend-b/' },
925
+ { 'path' => '/c', 'url' => 'http://backend-a/c' }
926
+ ]
927
+
928
+ apache::vhost { 'site.name.fdqn':
929
+
930
+ proxy_pass => $proxy_pass,
931
+ }
932
+ ```
933
+
934
+ #####`rack_base_uris`
935
+
936
+ Specifies the resource identifiers for a rack configuration. The file paths specified will be listed as rack application roots for passenger/rack in the `_rack.erb` template. Defaults to 'undef'.
937
+
938
+ #####`redirect_dest`
939
+
940
+ Specifies the address to redirect to. Defaults to 'undef'.
941
+
942
+ #####`redirect_source`
943
+
944
+ Specifies the source items? that will redirect to the destination specified in `redirect_dest`. If more than one item for redirect is supplied, the source and destination must be the same length, and the items are order-dependent.
945
+
946
+ ```puppet
947
+ apache::vhost { 'site.name.fdqn':
948
+
949
+ redirect_source => ['/images','/downloads'],
950
+ redirect_dest => ['http://img.example.com/','http://downloads.example.com/'],
951
+ }
952
+ ```
953
+
954
+ #####`redirect_status`
955
+
956
+ Specifies the status to append to the redirect. Defaults to 'undef'.
957
+
958
+ ```puppet
959
+ apache::vhost { 'site.name.fdqn':
960
+
961
+ redirect_status => ['temp','permanent'],
962
+ }
963
+ ```
964
+
965
+ #####`request_headers`
966
+
967
+ Specifies additional request headers.
968
+
969
+ ```puppet
970
+ apache::vhost { 'site.name.fdqn':
971
+
972
+ request_headers => [
973
+ 'append MirrorID "mirror 12"',
974
+ 'unset MirrorID',
975
+ ],
976
+ }
977
+ ```
978
+
979
+ #####`rewrite_base`
980
+
981
+ Limits the `rewrites` to the specified base URL. Defaults to 'undef'.
982
+
983
+ ```puppet
984
+ apache::vhost { 'site.name.fdqn':
985
+
986
+ rewrite_base => '/blog/',
987
+ rewrites => [
988
+ { rewrite_rule => ['^index\.html$ welcome.html'] }
989
+ ]
990
+ }
991
+ ```
992
+
993
+ The above example would limit the index.html -> welcome.html rewrite to only something inside of http://example.com/blog/.
994
+
995
+ #####`rewrites`
996
+
997
+ Creates URL rewrite rules. Defaults to 'undef'. This parameter allows you to specify, for example, that anyone trying to access index.html will be served welcome.html.
998
+
999
+ ```puppet
1000
+ apache::vhost { 'site.name.fdqn':
1001
+
1002
+ rewrites => [ { rewrite_rule => ['^index\.html$ welcome.html'] } ]
1003
+ }
1004
+ ```
1005
+
1006
+ Allows rewrite conditions, that when true, will execute the associated rule. For example
1007
+
1008
+ ```puppet
1009
+ apache::vhost { 'site.name.fdqn':
1010
+
1011
+ rewrites => [
1012
+ {
1013
+ comment => 'redirect IE',
1014
+ rewrite_cond => ['%{HTTP_USER_AGENT} ^MSIE'],
1015
+ rewrite_rule => ['^index\.html$ welcome.html'],
1016
+ }
1017
+ ]
1018
+ }
1019
+ ```
1020
+
1021
+ will rewrite URLs only if the visitor is using IE.
1022
+
1023
+ Multiple conditions can be applied, the following will rewrite index.html to welcome.html only when the browser is lynx or mozilla version 1 or 2
1024
+
1025
+ ```puppet
1026
+ apache::vhost { 'site.name.fdqn':
1027
+
1028
+ rewrites => [
1029
+ {
1030
+ comment => 'Lynx or Mozilla v1/2',
1031
+ rewrite_cond => ['%{HTTP_USER_AGENT} ^Lynx/ [OR]', '%{HTTP_USER_AGENT} ^Mozilla/[12]'],
1032
+ rewrite_rule => ['^index\.html$ welcome.html'],
1033
+ }
1034
+ ]
1035
+ }
1036
+ ```
1037
+
1038
+ Multiple rewrites and conditions are also possible
1039
+
1040
+ ```puppet
1041
+ apache::vhost { 'site.name.fdqn':
1042
+
1043
+ rewrites => [
1044
+ {
1045
+ comment => 'Lynx or Mozilla v1/2',
1046
+ rewrite_cond => ['%{HTTP_USER_AGENT} ^Lynx/ [OR]', '%{HTTP_USER_AGENT} ^Mozilla/[12]'],
1047
+ rewrite_rule => ['^index\.html$ welcome.html'],
1048
+ },
1049
+ {
1050
+ comment => 'Internet Explorer',
1051
+ rewrite_cond => ['%{HTTP_USER_AGENT} ^MSIE'],
1052
+ rewrite_rule => ['^index\.html$ /index.IE.html [L]'],
1053
+ },
1054
+ }
1055
+ rewrite_rule => ['^index\.cgi$ index.php', '^index\.html$ index.php', '^index\.asp$ index.html'],
1056
+ }
1057
+ ]
1058
+ }
1059
+ ```
1060
+
1061
+ refer to the [`mod_rewrite` documentation](http://httpd.apache.org/docs/current/mod/mod_rewrite.html) for more details on what is possible with rewrite rules and conditions
1062
+
1063
+ #####`scriptalias`
1064
+
1065
+ Defines a directory of CGI scripts to be aliased to the path '/cgi-bin'
1066
+
1067
+ #####`scriptaliases`
1068
+
1069
+ Passes a list of hashes to the vhost to create `ScriptAlias` or `ScriptAliasMatch` statements as per the [`mod_alias` documentation](http://httpd.apache.org/docs/current/mod/mod_alias.html). Each hash is expected to be of the form:
1070
+
1071
+ ```puppet
1072
+ scriptaliases => [
1073
+ {
1074
+ alias => '/myscript',
1075
+ path => '/usr/share/myscript',
1076
+ },
1077
+ {
1078
+ aliasmatch => '^/foo(.*)',
1079
+ path => '/usr/share/fooscripts$1',
1080
+ },
1081
+ {
1082
+ aliasmatch => '^/bar/(.*)',
1083
+ path => '/usr/share/bar/wrapper.sh/$1',
1084
+ },
1085
+ {
1086
+ alias => '/neatscript',
1087
+ path => '/usr/share/neatscript',
1088
+ },
1089
+ ]
1090
+ ```
1091
+
1092
+ These directives are created in the order specified. As with `Alias` and `AliasMatch` directives the more specific aliases should come before the more general ones to avoid shadowing.
1093
+
1094
+ #####`serveradmin`
1095
+
1096
+ Specifies the email address Apache will display when it renders one of its error pages.
1097
+
1098
+ #####`serveraliases`
1099
+
1100
+ Sets the server aliases of the site.
1101
+
1102
+ #####`servername`
1103
+
1104
+ Sets the primary name of the virtual host.
1105
+
1106
+ #####`setenv`
1107
+
1108
+ Used by HTTPD to set environment variables for vhosts. Defaults to '[]'.
1109
+
1110
+ #####`setenvif`
1111
+
1112
+ Used by HTTPD to conditionally set environment variables for vhosts. Defaults to '[]'.
1113
+
1114
+ #####`ssl`
1115
+
1116
+ Enables SSL for the virtual host. SSL vhosts only respond to HTTPS queries. Valid values are 'true' or 'false'.
1117
+
1118
+ #####`ssl_ca`
1119
+
1120
+ Specifies the certificate authority.
1121
+
1122
+ #####`ssl_cert`
1123
+
1124
+ Specifies the SSL certification.
1125
+
1126
+ #####`ssl_protocol`
1127
+
1128
+ Specifies the SSL Protocol (SSLProtocol).
1129
+
1130
+ #####`ssl_cipher`
1131
+
1132
+ Specifies the SSLCipherSuite.
1133
+
1134
+ #####`ssl_honorcipherorder`
1135
+
1136
+ Sets SSLHonorCipherOrder directive, used to prefer the server's cipher preference order
1137
+
1138
+ #####`ssl_certs_dir`
1139
+
1140
+ Specifies the location of the SSL certification directory. Defaults to `/etc/ssl/certs` on Debian and `/etc/pki/tls/certs` on RedHat.
1141
+
1142
+ #####`ssl_chain`
1143
+
1144
+ Specifies the SSL chain.
1145
+
1146
+ #####`ssl_crl`
1147
+
1148
+ Specifies the certificate revocation list to use.
1149
+
1150
+ #####`ssl_crl_path`
1151
+
1152
+ Specifies the location of the certificate revocation list.
1153
+
1154
+ #####`ssl_key`
1155
+
1156
+ Specifies the SSL key.
1157
+
1158
+ #####`ssl_verify_client`
1159
+
1160
+ Sets `SSLVerifyClient` directives as per the [Apache Core documentation](http://httpd.apache.org/docs/2.2/mod/mod_ssl.html#sslverifyclient). Defaults to undef.
1161
+ An example:
1162
+
1163
+ ```puppet
1164
+ apache::vhost { 'sample.example.net':
1165
+
1166
+ ssl_verify_client => 'optional',
1167
+ }
1168
+ ```
1169
+
1170
+ #####`ssl_verify_depth`
1171
+
1172
+ Sets `SSLVerifyDepth` directives as per the [Apache Core documentation](http://httpd.apache.org/docs/2.2/mod/mod_ssl.html#sslverifydepth). Defaults to undef.
1173
+ An example:
1174
+
1175
+ ```puppet
1176
+ apache::vhost { 'sample.example.net':
1177
+
1178
+ ssl_verify_depth => 1,
1179
+ }
1180
+ ```
1181
+
1182
+ #####`ssl_options`
1183
+
1184
+ Sets `SSLOptions` directives as per the [Apache Core documentation](http://httpd.apache.org/docs/2.2/mod/mod_ssl.html#ssloptions). This is the global setting for the vhost and can be a string or an array. Defaults to undef. A single string example:
1185
+
1186
+ ```puppet
1187
+ apache::vhost { 'sample.example.net':
1188
+
1189
+ ssl_options => '+ExportCertData',
1190
+ }
1191
+ ```
1192
+
1193
+ An array of strings example:
1194
+
1195
+ ```puppet
1196
+ apache::vhost { 'sample.example.net':
1197
+
1198
+ ssl_options => [ '+StrictRequire', '+ExportCertData' ],
1199
+ }
1200
+ ```
1201
+
1202
+ #####`ssl_proxyengine`
1203
+
1204
+ Specifies whether to use `SSLProxyEngine` or not. Defaults to `false`.
1205
+
1206
+ #####`vhost_name`
1207
+
1208
+ This parameter is for use with name-based virtual hosting. Defaults to '*'.
1209
+
1210
+ #####`itk`
1211
+
1212
+ Hash containing infos to configure itk as per the [ITK documentation](http://mpm-itk.sesse.net/).
1213
+
1214
+ Keys could be:
1215
+ * user + group
1216
+ * assignuseridexpr
1217
+ * assigngroupidexpr
1218
+ * maxclientvhost
1219
+ * nice
1220
+ * limituidrange (Linux 3.5.0 or newer)
1221
+ * limitgidrange (Linux 3.5.0 or newer)
1222
+
1223
+ Usage will typically look like:
1224
+
1225
+ ```puppet
1226
+ apache::vhost { 'sample.example.net':
1227
+ docroot => '/path/to/directory',
1228
+ itk => {
1229
+ user => 'someuser',
1230
+ group => 'somegroup',
1231
+ },
1232
+ }
1233
+ ```
1234
+
1235
+ ###Virtual Host Examples
1236
+
1237
+ The Apache module allows you to set up pretty much any configuration of virtual host you might desire. This section will address some common configurations. Please see the [Tests section](https://github.com/puppetlabs/puppetlabs-apache/tree/master/tests) for even more examples.
1238
+
1239
+ Configure a vhost with a server administrator
1240
+
1241
+ ```puppet
1242
+ apache::vhost { 'third.example.com':
1243
+ port => '80',
1244
+ docroot => '/var/www/third',
1245
+ serveradmin => 'admin@example.com',
1246
+ }
1247
+ ```
1248
+
1249
+ - - -
1250
+
1251
+ Set up a vhost with aliased servers
1252
+
1253
+ ```puppet
1254
+ apache::vhost { 'sixth.example.com':
1255
+ serveraliases => [
1256
+ 'sixth.example.org',
1257
+ 'sixth.example.net',
1258
+ ],
1259
+ port => '80',
1260
+ docroot => '/var/www/fifth',
1261
+ }
1262
+ ```
1263
+
1264
+ - - -
1265
+
1266
+ Configure a vhost with a cgi-bin
1267
+
1268
+ ```puppet
1269
+ apache::vhost { 'eleventh.example.com':
1270
+ port => '80',
1271
+ docroot => '/var/www/eleventh',
1272
+ scriptalias => '/usr/lib/cgi-bin',
1273
+ }
1274
+ ```
1275
+
1276
+ - - -
1277
+
1278
+ Set up a vhost with a rack configuration
1279
+
1280
+ ```puppet
1281
+ apache::vhost { 'fifteenth.example.com':
1282
+ port => '80',
1283
+ docroot => '/var/www/fifteenth',
1284
+ rack_base_uris => ['/rackapp1', '/rackapp2'],
1285
+ }
1286
+ ```
1287
+
1288
+ - - -
1289
+
1290
+ Set up a mix of SSL and non-SSL vhosts at the same domain
1291
+
1292
+ ```puppet
1293
+ #The non-ssl vhost
1294
+ apache::vhost { 'first.example.com non-ssl':
1295
+ servername => 'first.example.com',
1296
+ port => '80',
1297
+ docroot => '/var/www/first',
1298
+ }
1299
+
1300
+ #The SSL vhost at the same domain
1301
+ apache::vhost { 'first.example.com ssl':
1302
+ servername => 'first.example.com',
1303
+ port => '443',
1304
+ docroot => '/var/www/first',
1305
+ ssl => true,
1306
+ }
1307
+ ```
1308
+
1309
+ - - -
1310
+
1311
+ Configure a vhost to redirect non-SSL connections to SSL
1312
+
1313
+ ```puppet
1314
+ apache::vhost { 'sixteenth.example.com non-ssl':
1315
+ servername => 'sixteenth.example.com',
1316
+ port => '80',
1317
+ docroot => '/var/www/sixteenth',
1318
+ redirect_status => 'permanent'
1319
+ redirect_dest => 'https://sixteenth.example.com/'
1320
+ }
1321
+ apache::vhost { 'sixteenth.example.com ssl':
1322
+ servername => 'sixteenth.example.com',
1323
+ port => '443',
1324
+ docroot => '/var/www/sixteenth',
1325
+ ssl => true,
1326
+ }
1327
+ ```
1328
+
1329
+ - - -
1330
+
1331
+ Set up IP-based vhosts on any listen port and have them respond to requests on specific IP addresses. In this example, we will set listening on ports 80 and 81. This is required because the example vhosts are not declared with a port parameter.
1332
+
1333
+ ```puppet
1334
+ apache::listen { '80': }
1335
+ apache::listen { '81': }
1336
+ ```
1337
+
1338
+ Then we will set up the IP-based vhosts
1339
+
1340
+ ```puppet
1341
+ apache::vhost { 'first.example.com':
1342
+ ip => '10.0.0.10',
1343
+ docroot => '/var/www/first',
1344
+ ip_based => true,
1345
+ }
1346
+ apache::vhost { 'second.example.com':
1347
+ ip => '10.0.0.11',
1348
+ docroot => '/var/www/second',
1349
+ ip_based => true,
1350
+ }
1351
+ ```
1352
+
1353
+ - - -
1354
+
1355
+ Configure a mix of name-based and IP-based vhosts. First, we will add two IP-based vhosts on 10.0.0.10, one SSL and one non-SSL
1356
+
1357
+ ```puppet
1358
+ apache::vhost { 'The first IP-based vhost, non-ssl':
1359
+ servername => 'first.example.com',
1360
+ ip => '10.0.0.10',
1361
+ port => '80',
1362
+ ip_based => true,
1363
+ docroot => '/var/www/first',
1364
+ }
1365
+ apache::vhost { 'The first IP-based vhost, ssl':
1366
+ servername => 'first.example.com',
1367
+ ip => '10.0.0.10',
1368
+ port => '443',
1369
+ ip_based => true,
1370
+ docroot => '/var/www/first-ssl',
1371
+ ssl => true,
1372
+ }
1373
+ ```
1374
+
1375
+ Then, we will add two name-based vhosts listening on 10.0.0.20
1376
+
1377
+ ```puppet
1378
+ apache::vhost { 'second.example.com':
1379
+ ip => '10.0.0.20',
1380
+ port => '80',
1381
+ docroot => '/var/www/second',
1382
+ }
1383
+ apache::vhost { 'third.example.com':
1384
+ ip => '10.0.0.20',
1385
+ port => '80',
1386
+ docroot => '/var/www/third',
1387
+ }
1388
+ ```
1389
+
1390
+ If you want to add two name-based vhosts so that they will answer on either 10.0.0.10 or 10.0.0.20, you **MUST** declare `add_listen => 'false'` to disable the otherwise automatic 'Listen 80', as it will conflict with the preceding IP-based vhosts.
1391
+
1392
+ ```puppet
1393
+ apache::vhost { 'fourth.example.com':
1394
+ port => '80',
1395
+ docroot => '/var/www/fourth',
1396
+ add_listen => false,
1397
+ }
1398
+ apache::vhost { 'fifth.example.com':
1399
+ port => '80',
1400
+ docroot => '/var/www/fifth',
1401
+ add_listen => false,
1402
+ }
1403
+ ```
1404
+
1405
+ ##Implementation
1406
+
1407
+ ###Classes and Defined Types
1408
+
1409
+ ####Class: `apache::dev`
1410
+
1411
+ Installs Apache development libraries
1412
+
1413
+ ```puppet
1414
+ class { 'apache::dev': }
1415
+ ```
1416
+
1417
+ On FreeBSD you're required to define `apache::package` or `apache` class before `apache::dev`.
1418
+
1419
+ ####Defined Type: `apache::listen`
1420
+
1421
+ Controls which ports Apache binds to for listening based on the title:
1422
+
1423
+ ```puppet
1424
+ apache::listen { '80': }
1425
+ apache::listen { '443': }
1426
+ ```
1427
+
1428
+ Declaring this defined type will add all `Listen` directives to the `ports.conf` file in the Apache httpd configuration directory. `apache::listen` titles should always take the form of: `<port>`, `<ipv4>:<port>`, or `[<ipv6>]:<port>`
1429
+
1430
+ Apache httpd requires that `Listen` directives must be added for every port. The `apache::vhost` defined type will automatically add `Listen` directives unless the `apache::vhost` is passed `add_listen => false`.
1431
+
1432
+ ####Defined Type: `apache::namevirtualhost`
1433
+
1434
+ Enables named-based hosting of a virtual host
1435
+
1436
+ ```puppet
1437
+ class { 'apache::namevirtualhost`: }
1438
+ ```
1439
+
1440
+ Declaring this defined type will add all `NameVirtualHost` directives to the `ports.conf` file in the Apache https configuration directory. `apache::namevirtualhost` titles should always take the form of: `*`, `*:<port>`, `_default_:<port>`, `<ip>`, or `<ip>:<port>`.
1441
+
1442
+ ####Defined Type: `apache::balancermember`
1443
+
1444
+ Define members of a proxy_balancer set (mod_proxy_balancer). Very useful when using exported resources.
1445
+
1446
+ On every app server you can export a balancermember like this:
1447
+
1448
+ ```puppet
1449
+ @@apache::balancermember { "${::fqdn}-puppet00":
1450
+ balancer_cluster => 'puppet00',
1451
+ url => "ajp://${::fqdn}:8009"
1452
+ options => ['ping=5', 'disablereuse=on', 'retry=5', 'ttl=120'],
1453
+ }
1454
+ ```
1455
+
1456
+ And on the proxy itself you create the balancer cluster using the defined type apache::balancer:
1457
+
1458
+ ```puppet
1459
+ apache::balancer { 'puppet00': }
1460
+ ```
1461
+
1462
+ If you need to use ProxySet in the balncer config you can do as so:
1463
+
1464
+ ```puppet
1465
+ apache::balancer { 'puppet01':
1466
+ proxy_set => {'stickysession' => 'JSESSIONID'},
1467
+ }
1468
+ ```
1469
+
1470
+ ###Templates
1471
+
1472
+ The Apache module relies heavily on templates to enable the `vhost` and `apache::mod` defined types. These templates are built based on Facter facts around your operating system. Unless explicitly called out, most templates are not meant for configuration.
1473
+
1474
+ ##Limitations
1475
+
1476
+ This has been tested on Ubuntu Precise, Debian Wheezy, CentOS 5.8, and FreeBSD 9.1.
1477
+
1478
+ ##Development
1479
+
1480
+ ### Overview
1481
+
1482
+ Puppet Labs modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can’t access the huge number of platforms and myriad of hardware, software, and deployment configurations that Puppet is intended to serve.
1483
+
1484
+ We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.
1485
+
1486
+ You can read the complete module contribution guide [on the Puppet Labs wiki.](http://projects.puppetlabs.com/projects/module-site/wiki/Module_contributing)
1487
+
1488
+ ### Running tests
1489
+
1490
+ This project contains tests for both [rspec-puppet](http://rspec-puppet.com/) and [rspec-system](https://github.com/puppetlabs/rspec-system) to verify functionality. For in-depth information please see their respective documentation.
1491
+
1492
+ Quickstart:
1493
+
1494
+ gem install bundler
1495
+ bundle install
1496
+ bundle exec rake spec
1497
+ bundle exec rake spec:system
1498
+
1499
+ ##Copyright and License
1500
+
1501
+ Copyright (C) 2012 [Puppet Labs](https://www.puppetlabs.com/) Inc
1502
+
1503
+ Puppet Labs can be contacted at: info@puppetlabs.com
1504
+
1505
+ Licensed under the Apache License, Version 2.0 (the "License");
1506
+ you may not use this file except in compliance with the License.
1507
+ You may obtain a copy of the License at
1508
+
1509
+ http://www.apache.org/licenses/LICENSE-2.0
1510
+
1511
+ Unless required by applicable law or agreed to in writing, software
1512
+ distributed under the License is distributed on an "AS IS" BASIS,
1513
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1514
+ See the License for the specific language governing permissions and
1515
+ limitations under the License.