fast_food 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (236) hide show
  1. data/.gitignore +17 -0
  2. data/Gemfile +4 -0
  3. data/LICENSE.txt +22 -0
  4. data/README.md +73 -0
  5. data/Rakefile +8 -0
  6. data/chef/.chef/bootstrap/chef-solo.erb +27 -0
  7. data/chef/.chef/knife.rb +8 -0
  8. data/chef/.gitignore +1 -0
  9. data/chef/README +3 -0
  10. data/chef/cookbooks/README +1 -0
  11. data/chef/cookbooks/apache2/.gitignore +1 -0
  12. data/chef/cookbooks/apache2/CHANGELOG.md +81 -0
  13. data/chef/cookbooks/apache2/CONTRIBUTING +29 -0
  14. data/chef/cookbooks/apache2/Gemfile +10 -0
  15. data/chef/cookbooks/apache2/LICENSE +201 -0
  16. data/chef/cookbooks/apache2/README.md +373 -0
  17. data/chef/cookbooks/apache2/attributes/default.rb +149 -0
  18. data/chef/cookbooks/apache2/attributes/mod_auth_openid.rb +32 -0
  19. data/chef/cookbooks/apache2/definitions/apache_conf.rb +26 -0
  20. data/chef/cookbooks/apache2/definitions/apache_module.rb +53 -0
  21. data/chef/cookbooks/apache2/definitions/apache_site.rb +43 -0
  22. data/chef/cookbooks/apache2/definitions/web_app.rb +49 -0
  23. data/chef/cookbooks/apache2/files/default/apache2_module_conf_generate.pl +41 -0
  24. data/chef/cookbooks/apache2/files/default/tests/minitest/default_test.rb +64 -0
  25. data/chef/cookbooks/apache2/files/default/tests/minitest/helpers.rb +36 -0
  26. data/chef/cookbooks/apache2/files/default/tests/minitest/mod_auth_openid_test.rb +25 -0
  27. data/chef/cookbooks/apache2/files/default/tests/minitest/mod_dav_svn_test.rb +16 -0
  28. data/chef/cookbooks/apache2/files/default/tests/minitest/mod_perl_test.rb +22 -0
  29. data/chef/cookbooks/apache2/files/default/tests/minitest/mod_php5_test.rb +19 -0
  30. data/chef/cookbooks/apache2/files/default/tests/minitest/mod_python_test.rb +14 -0
  31. data/chef/cookbooks/apache2/files/default/tests/minitest/mod_ssl_test.rb +19 -0
  32. data/chef/cookbooks/apache2/files/default/tests/minitest/mod_wsgi_test.rb +14 -0
  33. data/chef/cookbooks/apache2/files/default/tests/minitest/mod_xsendfile_test.rb +14 -0
  34. data/chef/cookbooks/apache2/files/default/tests/minitest/modules_test.rb +19 -0
  35. data/chef/cookbooks/apache2/metadata.json +511 -0
  36. data/chef/cookbooks/apache2/metadata.rb +205 -0
  37. data/chef/cookbooks/apache2/recipes/default.rb +221 -0
  38. data/chef/cookbooks/apache2/recipes/god_monitor.rb +33 -0
  39. data/chef/cookbooks/apache2/recipes/mod_alias.rb +22 -0
  40. data/chef/cookbooks/apache2/recipes/mod_apreq2.rb +45 -0
  41. data/chef/cookbooks/apache2/recipes/mod_auth_basic.rb +20 -0
  42. data/chef/cookbooks/apache2/recipes/mod_auth_digest.rb +20 -0
  43. data/chef/cookbooks/apache2/recipes/mod_auth_openid.rb +113 -0
  44. data/chef/cookbooks/apache2/recipes/mod_authn_file.rb +20 -0
  45. data/chef/cookbooks/apache2/recipes/mod_authnz_ldap.rb +20 -0
  46. data/chef/cookbooks/apache2/recipes/mod_authz_default.rb +20 -0
  47. data/chef/cookbooks/apache2/recipes/mod_authz_groupfile.rb +20 -0
  48. data/chef/cookbooks/apache2/recipes/mod_authz_host.rb +20 -0
  49. data/chef/cookbooks/apache2/recipes/mod_authz_user.rb +20 -0
  50. data/chef/cookbooks/apache2/recipes/mod_autoindex.rb +22 -0
  51. data/chef/cookbooks/apache2/recipes/mod_cgi.rb +20 -0
  52. data/chef/cookbooks/apache2/recipes/mod_dav.rb +20 -0
  53. data/chef/cookbooks/apache2/recipes/mod_dav_fs.rb +20 -0
  54. data/chef/cookbooks/apache2/recipes/mod_dav_svn.rb +29 -0
  55. data/chef/cookbooks/apache2/recipes/mod_deflate.rb +22 -0
  56. data/chef/cookbooks/apache2/recipes/mod_dir.rb +22 -0
  57. data/chef/cookbooks/apache2/recipes/mod_env.rb +20 -0
  58. data/chef/cookbooks/apache2/recipes/mod_expires.rb +20 -0
  59. data/chef/cookbooks/apache2/recipes/mod_fastcgi.rb +26 -0
  60. data/chef/cookbooks/apache2/recipes/mod_fcgid.rb +53 -0
  61. data/chef/cookbooks/apache2/recipes/mod_headers.rb +20 -0
  62. data/chef/cookbooks/apache2/recipes/mod_ldap.rb +20 -0
  63. data/chef/cookbooks/apache2/recipes/mod_log_config.rb +24 -0
  64. data/chef/cookbooks/apache2/recipes/mod_logio.rb +24 -0
  65. data/chef/cookbooks/apache2/recipes/mod_mime.rb +22 -0
  66. data/chef/cookbooks/apache2/recipes/mod_negotiation.rb +22 -0
  67. data/chef/cookbooks/apache2/recipes/mod_perl.rb +39 -0
  68. data/chef/cookbooks/apache2/recipes/mod_php5.rb +99 -0
  69. data/chef/cookbooks/apache2/recipes/mod_proxy.rb +22 -0
  70. data/chef/cookbooks/apache2/recipes/mod_proxy_ajp.rb +21 -0
  71. data/chef/cookbooks/apache2/recipes/mod_proxy_balancer.rb +20 -0
  72. data/chef/cookbooks/apache2/recipes/mod_proxy_connect.rb +20 -0
  73. data/chef/cookbooks/apache2/recipes/mod_proxy_http.rb +20 -0
  74. data/chef/cookbooks/apache2/recipes/mod_python.rb +32 -0
  75. data/chef/cookbooks/apache2/recipes/mod_rewrite.rb +20 -0
  76. data/chef/cookbooks/apache2/recipes/mod_setenvif.rb +22 -0
  77. data/chef/cookbooks/apache2/recipes/mod_ssl.rb +43 -0
  78. data/chef/cookbooks/apache2/recipes/mod_status.rb +22 -0
  79. data/chef/cookbooks/apache2/recipes/mod_wsgi.rb +27 -0
  80. data/chef/cookbooks/apache2/recipes/mod_xsendfile.rb +27 -0
  81. data/chef/cookbooks/apache2/templates/default/a2dismod.erb +22 -0
  82. data/chef/cookbooks/apache2/templates/default/a2dissite.erb +29 -0
  83. data/chef/cookbooks/apache2/templates/default/a2enmod.erb +37 -0
  84. data/chef/cookbooks/apache2/templates/default/a2ensite.erb +38 -0
  85. data/chef/cookbooks/apache2/templates/default/apache2.conf.erb +237 -0
  86. data/chef/cookbooks/apache2/templates/default/apache2.god.erb +19 -0
  87. data/chef/cookbooks/apache2/templates/default/charset.erb +6 -0
  88. data/chef/cookbooks/apache2/templates/default/default-site.erb +57 -0
  89. data/chef/cookbooks/apache2/templates/default/mods/README +2 -0
  90. data/chef/cookbooks/apache2/templates/default/mods/alias.conf.erb +24 -0
  91. data/chef/cookbooks/apache2/templates/default/mods/authopenid.load.erb +1 -0
  92. data/chef/cookbooks/apache2/templates/default/mods/autoindex.conf.erb +101 -0
  93. data/chef/cookbooks/apache2/templates/default/mods/deflate.conf.erb +16 -0
  94. data/chef/cookbooks/apache2/templates/default/mods/dir.conf.erb +5 -0
  95. data/chef/cookbooks/apache2/templates/default/mods/fastcgi.conf.erb +5 -0
  96. data/chef/cookbooks/apache2/templates/default/mods/fcgid.conf.erb +10 -0
  97. data/chef/cookbooks/apache2/templates/default/mods/mime.conf.erb +198 -0
  98. data/chef/cookbooks/apache2/templates/default/mods/negotiation.conf.erb +18 -0
  99. data/chef/cookbooks/apache2/templates/default/mods/php5.conf.erb +16 -0
  100. data/chef/cookbooks/apache2/templates/default/mods/proxy.conf.erb +19 -0
  101. data/chef/cookbooks/apache2/templates/default/mods/setenvif.conf.erb +28 -0
  102. data/chef/cookbooks/apache2/templates/default/mods/ssl.conf.erb +76 -0
  103. data/chef/cookbooks/apache2/templates/default/mods/status.conf.erb +26 -0
  104. data/chef/cookbooks/apache2/templates/default/port_apache.erb +2 -0
  105. data/chef/cookbooks/apache2/templates/default/ports.conf.erb +6 -0
  106. data/chef/cookbooks/apache2/templates/default/security.erb +50 -0
  107. data/chef/cookbooks/apache2/templates/default/web_app.conf.erb +43 -0
  108. data/chef/cookbooks/build-essential/.gitignore +4 -0
  109. data/chef/cookbooks/build-essential/CHANGELOG.md +31 -0
  110. data/chef/cookbooks/build-essential/CONTRIBUTING +29 -0
  111. data/chef/cookbooks/build-essential/Gemfile +3 -0
  112. data/chef/cookbooks/build-essential/LICENSE +201 -0
  113. data/chef/cookbooks/build-essential/README.md +129 -0
  114. data/chef/cookbooks/build-essential/attributes/default.rb +33 -0
  115. data/chef/cookbooks/build-essential/metadata.json +41 -0
  116. data/chef/cookbooks/build-essential/metadata.rb +14 -0
  117. data/chef/cookbooks/build-essential/recipes/default.rb +92 -0
  118. data/chef/cookbooks/database/.gitignore +1 -0
  119. data/chef/cookbooks/database/CHANGELOG.md +46 -0
  120. data/chef/cookbooks/database/CONTRIBUTING +29 -0
  121. data/chef/cookbooks/database/LICENSE +201 -0
  122. data/chef/cookbooks/database/README.md +468 -0
  123. data/chef/cookbooks/database/libraries/provider_database_mysql.rb +103 -0
  124. data/chef/cookbooks/database/libraries/provider_database_mysql_user.rb +76 -0
  125. data/chef/cookbooks/database/libraries/provider_database_postgresql.rb +131 -0
  126. data/chef/cookbooks/database/libraries/provider_database_postgresql_user.rb +83 -0
  127. data/chef/cookbooks/database/libraries/provider_database_sql_server.rb +109 -0
  128. data/chef/cookbooks/database/libraries/provider_database_sql_server_user.rb +106 -0
  129. data/chef/cookbooks/database/libraries/resource_database.rb +119 -0
  130. data/chef/cookbooks/database/libraries/resource_database_user.rb +90 -0
  131. data/chef/cookbooks/database/libraries/resource_mysql_database.rb +34 -0
  132. data/chef/cookbooks/database/libraries/resource_mysql_database_user.rb +34 -0
  133. data/chef/cookbooks/database/libraries/resource_postgresql_database.rb +35 -0
  134. data/chef/cookbooks/database/libraries/resource_postgresql_database_user.rb +35 -0
  135. data/chef/cookbooks/database/libraries/resource_sql_server_database.rb +34 -0
  136. data/chef/cookbooks/database/libraries/resource_sql_server_database_user.rb +34 -0
  137. data/chef/cookbooks/database/metadata.json +45 -0
  138. data/chef/cookbooks/database/metadata.rb +22 -0
  139. data/chef/cookbooks/database/recipes/default.rb +20 -0
  140. data/chef/cookbooks/database/recipes/ebs_backup.rb +89 -0
  141. data/chef/cookbooks/database/recipes/ebs_volume.rb +204 -0
  142. data/chef/cookbooks/database/recipes/master.rb +78 -0
  143. data/chef/cookbooks/database/recipes/mysql.rb +20 -0
  144. data/chef/cookbooks/database/recipes/postgresql.rb +20 -0
  145. data/chef/cookbooks/database/recipes/snapshot.rb +62 -0
  146. data/chef/cookbooks/database/templates/default/app_grants.sql.erb +8 -0
  147. data/chef/cookbooks/database/templates/default/aws_config.erb +3 -0
  148. data/chef/cookbooks/database/templates/default/chef-solo-database-snapshot.cron.erb +6 -0
  149. data/chef/cookbooks/database/templates/default/chef-solo-database-snapshot.json.erb +1 -0
  150. data/chef/cookbooks/database/templates/default/chef-solo-database-snapshot.rb.erb +6 -0
  151. data/chef/cookbooks/database/templates/default/ebs-backup-cron.erb +2 -0
  152. data/chef/cookbooks/database/templates/default/ebs-db-backup.sh.erb +8 -0
  153. data/chef/cookbooks/database/templates/default/ebs-db-restore.sh.erb +10 -0
  154. data/chef/cookbooks/database/templates/default/s3cfg.erb +27 -0
  155. data/chef/cookbooks/fast_food/recipes/default.rb +24 -0
  156. data/chef/cookbooks/fast_food/recipes/site.rb +7 -0
  157. data/chef/cookbooks/fast_food/templates/default/web_app.conf.erb +43 -0
  158. data/chef/cookbooks/git/CHANGELOG.md +49 -0
  159. data/chef/cookbooks/git/CONTRIBUTING +29 -0
  160. data/chef/cookbooks/git/LICENSE +201 -0
  161. data/chef/cookbooks/git/README.md +115 -0
  162. data/chef/cookbooks/git/attributes/default.rb +37 -0
  163. data/chef/cookbooks/git/metadata.json +48 -0
  164. data/chef/cookbooks/git/metadata.rb +20 -0
  165. data/chef/cookbooks/git/recipes/default.rb +46 -0
  166. data/chef/cookbooks/git/recipes/server.rb +38 -0
  167. data/chef/cookbooks/git/recipes/source.rb +48 -0
  168. data/chef/cookbooks/git/recipes/windows.rb +32 -0
  169. data/chef/cookbooks/git/templates/default/sv-git-daemon-log-run.erb +2 -0
  170. data/chef/cookbooks/git/templates/default/sv-git-daemon-run.erb +3 -0
  171. data/chef/cookbooks/imagemagick/README.md +57 -0
  172. data/chef/cookbooks/imagemagick/metadata.json +37 -0
  173. data/chef/cookbooks/imagemagick/metadata.rb +14 -0
  174. data/chef/cookbooks/imagemagick/recipes/default.rb +25 -0
  175. data/chef/cookbooks/imagemagick/recipes/devel.rb +32 -0
  176. data/chef/cookbooks/imagemagick/recipes/rmagick.rb +22 -0
  177. data/chef/cookbooks/mysql/.gitignore +5 -0
  178. data/chef/cookbooks/mysql/CHANGELOG.md +125 -0
  179. data/chef/cookbooks/mysql/CONTRIBUTING +29 -0
  180. data/chef/cookbooks/mysql/Gemfile +8 -0
  181. data/chef/cookbooks/mysql/LICENSE +201 -0
  182. data/chef/cookbooks/mysql/README.md +227 -0
  183. data/chef/cookbooks/mysql/attributes/client.rb +50 -0
  184. data/chef/cookbooks/mysql/attributes/server.rb +240 -0
  185. data/chef/cookbooks/mysql/files/default/tests/minitest/server_test.rb +36 -0
  186. data/chef/cookbooks/mysql/files/default/tests/minitest/support/helpers.rb +11 -0
  187. data/chef/cookbooks/mysql/libraries/helpers.rb +33 -0
  188. data/chef/cookbooks/mysql/metadata.json +418 -0
  189. data/chef/cookbooks/mysql/metadata.rb +140 -0
  190. data/chef/cookbooks/mysql/recipes/client.rb +59 -0
  191. data/chef/cookbooks/mysql/recipes/default.rb +20 -0
  192. data/chef/cookbooks/mysql/recipes/ruby.rb +36 -0
  193. data/chef/cookbooks/mysql/recipes/server.rb +221 -0
  194. data/chef/cookbooks/mysql/recipes/server_ec2.rb +51 -0
  195. data/chef/cookbooks/mysql/templates/default/debian.cnf.erb +12 -0
  196. data/chef/cookbooks/mysql/templates/default/grants.sql.erb +15 -0
  197. data/chef/cookbooks/mysql/templates/default/my.cnf.erb +312 -0
  198. data/chef/cookbooks/mysql/templates/default/mysql-server.seed.erb +10 -0
  199. data/chef/cookbooks/mysql/templates/default/port_mysql.erb +3 -0
  200. data/chef/cookbooks/mysql/templates/windows/my.cnf.erb +61 -0
  201. data/chef/cookbooks/openssl/README.md +37 -0
  202. data/chef/cookbooks/openssl/libraries/secure_password.rb +37 -0
  203. data/chef/cookbooks/openssl/metadata.json +30 -0
  204. data/chef/cookbooks/openssl/metadata.rb +8 -0
  205. data/chef/cookbooks/openssl/recipes/default.rb +19 -0
  206. data/chef/cookbooks/passenger_apache2/.gitignore +4 -0
  207. data/chef/cookbooks/passenger_apache2/CHANGELOG.md +29 -0
  208. data/chef/cookbooks/passenger_apache2/CONTRIBUTING +29 -0
  209. data/chef/cookbooks/passenger_apache2/Gemfile +3 -0
  210. data/chef/cookbooks/passenger_apache2/LICENSE +201 -0
  211. data/chef/cookbooks/passenger_apache2/README.md +77 -0
  212. data/chef/cookbooks/passenger_apache2/attributes/default.rb +5 -0
  213. data/chef/cookbooks/passenger_apache2/metadata.json +38 -0
  214. data/chef/cookbooks/passenger_apache2/metadata.rb +17 -0
  215. data/chef/cookbooks/passenger_apache2/recipes/default.rb +60 -0
  216. data/chef/cookbooks/passenger_apache2/recipes/mod_rails.rb +47 -0
  217. data/chef/cookbooks/passenger_apache2/templates/default/passenger.conf.erb +3 -0
  218. data/chef/cookbooks/passenger_apache2/templates/default/passenger.load.erb +1 -0
  219. data/chef/cookbooks/passenger_apache2/templates/default/passenger_web_app.conf.erb +32 -0
  220. data/chef/cookbooks/passenger_apache2/templates/default/web_app.conf.erb +32 -0
  221. data/chef/roles/apache2.rb +12 -0
  222. data/chef/roles/mysql.rb +18 -0
  223. data/chef/solo.rb +5 -0
  224. data/config/deploy/centos.sh +17 -0
  225. data/config/deploy/production.rb +3 -0
  226. data/config/deploy/ubuntu.sh +10 -0
  227. data/config/deploy.rb +99 -0
  228. data/config/deployment.yml +6 -0
  229. data/fast_food.gemspec +26 -0
  230. data/lib/fast_food/railtie.rb +9 -0
  231. data/lib/fast_food/version.rb +3 -0
  232. data/lib/fast_food.rb +5 -0
  233. data/lib/tasks/fast_food.rake +100 -0
  234. data/spec/lib/fast_food_spec.rb +0 -0
  235. data/spec/spec_helper.rb +1 -0
  236. metadata +349 -0
@@ -0,0 +1,205 @@
1
+ maintainer "Opscode, Inc."
2
+ maintainer_email "cookbooks@opscode.com"
3
+ license "Apache 2.0"
4
+ description "Installs and configures all aspects of apache2 using Debian style symlinks with helper definitions"
5
+ long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
6
+ version "1.1.12"
7
+ recipe "apache2", "Main Apache configuration"
8
+ recipe "apache2::mod_alias", "Apache module 'alias' with config file"
9
+ recipe "apache2::mod_apreq2", "Apache module 'apreq'"
10
+ recipe "apache2::mod_auth_basic", "Apache module 'auth_basic'"
11
+ recipe "apache2::mod_auth_digest", "Apache module 'auth_digest'"
12
+ recipe "apache2::mod_auth_openid", "Apache module 'authopenid'"
13
+ recipe "apache2::mod_authn_file", "Apache module 'authn_file'"
14
+ recipe "apache2::mod_authnz_ldap", "Apache module 'authnz_ldap'"
15
+ recipe "apache2::mod_authz_default", "Apache module 'authz_default'"
16
+ recipe "apache2::mod_authz_groupfile", "Apache module 'authz_groupfile'"
17
+ recipe "apache2::mod_authz_host", "Apache module 'authz_host'"
18
+ recipe "apache2::mod_authz_user", "Apache module 'authz_user'"
19
+ recipe "apache2::mod_autoindex", "Apache module 'autoindex' with config file"
20
+ recipe "apache2::mod_cgi", "Apache module 'cgi'"
21
+ recipe "apache2::mod_dav", "Apache module 'dav'"
22
+ recipe "apache2::mod_dav_svn", "Apache module 'dav_svn'"
23
+ recipe "apache2::mod_deflate", "Apache module 'deflate' with config file"
24
+ recipe "apache2::mod_dir", "Apache module 'dir' with config file"
25
+ recipe "apache2::mod_env", "Apache module 'env'"
26
+ recipe "apache2::mod_expires", "Apache module 'expires'"
27
+ recipe "apache2::mod_fcgid", "Apache module 'fcgid', package on ubuntu/debian, rhel/centos, compile source on suse; with config file"
28
+ recipe "apache2::mod_headers", "Apache module 'headers'"
29
+ recipe "apache2::mod_ldap", "Apache module 'ldap'"
30
+ recipe "apache2::mod_log_config", "Apache module 'log_config'"
31
+ recipe "apache2::mod_mime", "Apache module 'mime' with config file"
32
+ recipe "apache2::mod_negotiation", "Apache module 'negotiation' with config file"
33
+ recipe "apache2::mod_perl", "Apache module 'perl'"
34
+ recipe "apache2::mod_php5", "Apache module 'php5'"
35
+ recipe "apache2::mod_proxy", "Apache module 'proxy' with config file"
36
+ recipe "apache2::mod_proxy_ajp", "Apache module 'proxy_ajp'"
37
+ recipe "apache2::mod_proxy_balancer", "Apache module 'proxy_balancer'"
38
+ recipe "apache2::mod_proxy_connect", "Apache module 'proxy_connect'"
39
+ recipe "apache2::mod_proxy_http", "Apache module 'proxy_http'"
40
+ recipe "apache2::mod_python", "Apache module 'python'"
41
+ recipe "apache2::mod_rewrite", "Apache module 'rewrite'"
42
+ recipe "apache2::mod_setenvif", "Apache module 'setenvif' with config file"
43
+ recipe "apache2::mod_ssl", "Apache module 'ssl' with config file, adds port 443 to listen_ports"
44
+ recipe "apache2::mod_status", "Apache module 'status' with config file"
45
+ recipe "apache2::mod_xsendfile", "Apache module 'xsendfile'"
46
+
47
+ %w{redhat centos scientific fedora debian ubuntu arch freebsd amazon}.each do |os|
48
+ supports os
49
+ end
50
+
51
+ attribute "apache",
52
+ :display_name => "Apache Hash",
53
+ :description => "Hash of Apache attributes",
54
+ :type => "hash"
55
+
56
+ attribute "apache/dir",
57
+ :display_name => "Apache Directory",
58
+ :description => "Location for Apache configuration",
59
+ :default => "/etc/apache2"
60
+
61
+ attribute "apache/log_dir",
62
+ :display_name => "Apache Log Directory",
63
+ :description => "Location for Apache logs",
64
+ :default => "/etc/apache2"
65
+
66
+ attribute "apache/user",
67
+ :display_name => "Apache User",
68
+ :description => "User Apache runs as",
69
+ :default => "www-data"
70
+
71
+ attribute "apache/binary",
72
+ :display_name => "Apache Binary",
73
+ :description => "Apache server daemon program",
74
+ :default => "/usr/sbin/apache2"
75
+
76
+ attribute "apache/icondir",
77
+ :display_name => "Apache Icondir",
78
+ :description => "Directory location for icons",
79
+ :default => "/usr/share/apache2/icons"
80
+
81
+ attribute "apache/listen_ports",
82
+ :display_name => "Apache Listen Ports",
83
+ :description => "Ports that Apache should listen on",
84
+ :type => "array",
85
+ :default => [ "80", "443" ]
86
+
87
+ attribute "apache/contact",
88
+ :display_name => "Apache Contact",
89
+ :description => "Email address of webmaster",
90
+ :default => "ops@example.com"
91
+
92
+ attribute "apache/timeout",
93
+ :display_name => "Apache Timeout",
94
+ :description => "Connection timeout value",
95
+ :default => "300"
96
+
97
+ attribute "apache/keepalive",
98
+ :display_name => "Apache Keepalive",
99
+ :description => "HTTP persistent connections",
100
+ :default => "On"
101
+
102
+ attribute "apache/keepaliverequests",
103
+ :display_name => "Apache Keepalive Requests",
104
+ :description => "Number of requests allowed on a persistent connection",
105
+ :default => "100"
106
+
107
+ attribute "apache/keepalivetimeout",
108
+ :display_name => "Apache Keepalive Timeout",
109
+ :description => "Time to wait for requests on persistent connection",
110
+ :default => "5"
111
+
112
+ attribute "apache/servertokens",
113
+ :display_name => "Apache Server Tokens",
114
+ :description => "Server response header",
115
+ :default => "Prod"
116
+
117
+ attribute "apache/serversignature",
118
+ :display_name => "Apache Server Signature",
119
+ :description => "Configure footer on server-generated documents",
120
+ :default => "On"
121
+
122
+ attribute "apache/traceenable",
123
+ :display_name => "Apache Trace Enable",
124
+ :description => "Determine behavior of TRACE requests",
125
+ :default => "On"
126
+
127
+ attribute "apache/allowed_openids",
128
+ :display_name => "Apache Allowed OpenIDs",
129
+ :description => "Array of OpenIDs allowed to authenticate",
130
+ :default => ""
131
+
132
+ attribute "apache/prefork",
133
+ :display_name => "Apache Prefork",
134
+ :description => "Hash of Apache prefork tuning attributes.",
135
+ :type => "hash"
136
+
137
+ attribute "apache/prefork/startservers",
138
+ :display_name => "Apache Prefork MPM StartServers",
139
+ :description => "Number of MPM servers to start",
140
+ :default => "16"
141
+
142
+ attribute "apache/prefork/minspareservers",
143
+ :display_name => "Apache Prefork MPM MinSpareServers",
144
+ :description => "Minimum number of spare server processes",
145
+ :default => "16"
146
+
147
+ attribute "apache/prefork/maxspareservers",
148
+ :display_name => "Apache Prefork MPM MaxSpareServers",
149
+ :description => "Maximum number of spare server processes",
150
+ :default => "32"
151
+
152
+ attribute "apache/prefork/serverlimit",
153
+ :display_name => "Apache Prefork MPM ServerLimit",
154
+ :description => "Upper limit on configurable server processes",
155
+ :default => "400"
156
+
157
+ attribute "apache/prefork/maxclients",
158
+ :display_name => "Apache Prefork MPM MaxClients",
159
+ :description => "Maximum number of simultaneous connections",
160
+ :default => "400"
161
+
162
+ attribute "apache/prefork/maxrequestsperchild",
163
+ :display_name => "Apache Prefork MPM MaxRequestsPerChild",
164
+ :description => "Maximum number of request a child process will handle",
165
+ :default => "10000"
166
+
167
+ attribute "apache/worker",
168
+ :display_name => "Apache Worker",
169
+ :description => "Hash of Apache prefork tuning attributes.",
170
+ :type => "hash"
171
+
172
+ attribute "apache/worker/startservers",
173
+ :display_name => "Apache Worker MPM StartServers",
174
+ :description => "Initial number of server processes to start",
175
+ :default => "4"
176
+
177
+ attribute "apache/worker/maxclients",
178
+ :display_name => "Apache Worker MPM MaxClients",
179
+ :description => "Maximum number of simultaneous connections",
180
+ :default => "1024"
181
+
182
+ attribute "apache/worker/minsparethreads",
183
+ :display_name => "Apache Worker MPM MinSpareThreads",
184
+ :description => "Minimum number of spare worker threads",
185
+ :default => "64"
186
+
187
+ attribute "apache/worker/maxsparethreads",
188
+ :display_name => "Apache Worker MPM MaxSpareThreads",
189
+ :description => "Maximum number of spare worker threads",
190
+ :default => "192"
191
+
192
+ attribute "apache/worker/threadsperchild",
193
+ :display_name => "Apache Worker MPM ThreadsPerChild",
194
+ :description => "Constant number of worker threads in each server process",
195
+ :default => "64"
196
+
197
+ attribute "apache/worker/maxrequestsperchild",
198
+ :display_name => "Apache Worker MPM MaxRequestsPerChild",
199
+ :description => "Maximum number of request a child process will handle",
200
+ :default => "0"
201
+
202
+ attribute "apache/default_modules",
203
+ :display_name => "Apache Default Modules",
204
+ :description => "Default modules to enable via recipes",
205
+ :default => "status alias auth_basic authn_file authz_default authz_groupfile authz_host authz_user autoindex dir env mime negotiation setenvif"
@@ -0,0 +1,221 @@
1
+ #
2
+ # Cookbook Name:: apache2
3
+ # Recipe:: default
4
+ #
5
+ # Copyright 2008-2009, Opscode, Inc.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+
20
+ package "apache2" do
21
+ package_name node['apache']['package']
22
+ action :install
23
+ end
24
+
25
+ service "apache2" do
26
+ case node['platform']
27
+ when "redhat","centos","scientific","fedora","suse","amazon"
28
+ service_name "httpd"
29
+ # If restarted/reloaded too quickly httpd has a habit of failing.
30
+ # This may happen with multiple recipes notifying apache to restart - like
31
+ # during the initial bootstrap.
32
+ restart_command "/sbin/service httpd restart && sleep 1"
33
+ reload_command "/sbin/service httpd reload && sleep 1"
34
+ when "debian","ubuntu"
35
+ service_name "apache2"
36
+ restart_command "/usr/sbin/invoke-rc.d apache2 restart && sleep 1"
37
+ reload_command "/usr/sbin/invoke-rc.d apache2 reload && sleep 1"
38
+ when "arch"
39
+ service_name "httpd"
40
+ when "freebsd"
41
+ service_name "apache22"
42
+ end
43
+ supports value_for_platform(
44
+ "debian" => { "4.0" => [ :restart, :reload ], "default" => [ :restart, :reload, :status ] },
45
+ "ubuntu" => { "default" => [ :restart, :reload, :status ] },
46
+ "redhat" => { "default" => [ :restart, :reload, :status ] },
47
+ "centos" => { "default" => [ :restart, :reload, :status ] },
48
+ "scientific" => { "default" => [ :restart, :reload, :status ] },
49
+ "fedora" => { "default" => [ :restart, :reload, :status ] },
50
+ "arch" => { "default" => [ :restart, :reload, :status ] },
51
+ "suse" => { "default" => [ :restart, :reload, :status ] },
52
+ "freebsd" => { "default" => [ :restart, :reload, :status ] },
53
+ "amazon" => { "default" => [ :restart, :reload, :status ] },
54
+ "default" => { "default" => [:restart, :reload ] }
55
+ )
56
+ action :enable
57
+ end
58
+
59
+ if platform?("redhat", "centos", "scientific", "fedora", "arch", "suse", "freebsd", "amazon")
60
+ directory node['apache']['log_dir'] do
61
+ mode 0755
62
+ action :create
63
+ end
64
+
65
+ package "perl"
66
+
67
+ cookbook_file "/usr/local/bin/apache2_module_conf_generate.pl" do
68
+ source "apache2_module_conf_generate.pl"
69
+ mode 0755
70
+ owner "root"
71
+ group node['apache']['root_group']
72
+ end
73
+
74
+ %w{sites-available sites-enabled mods-available mods-enabled}.each do |dir|
75
+ directory "#{node['apache']['dir']}/#{dir}" do
76
+ mode 0755
77
+ owner "root"
78
+ group node['apache']['root_group']
79
+ action :create
80
+ end
81
+ end
82
+
83
+ execute "generate-module-list" do
84
+ command "/usr/local/bin/apache2_module_conf_generate.pl #{node['apache']['lib_dir']} #{node['apache']['dir']}/mods-available"
85
+ action :run
86
+ end
87
+
88
+ %w{a2ensite a2dissite a2enmod a2dismod}.each do |modscript|
89
+ template "/usr/sbin/#{modscript}" do
90
+ source "#{modscript}.erb"
91
+ mode 0700
92
+ owner "root"
93
+ group node['apache']['root_group']
94
+ end
95
+ end
96
+
97
+ # installed by default on centos/rhel, remove in favour of mods-enabled
98
+ %w{ proxy_ajp auth_pam authz_ldap webalizer ssl welcome }.each do |f|
99
+ file "#{node['apache']['dir']}/conf.d/#{f}.conf" do
100
+ action :delete
101
+ backup false
102
+ end
103
+ end
104
+
105
+ # installed by default on centos/rhel, remove in favour of mods-enabled
106
+ file "#{node['apache']['dir']}/conf.d/README" do
107
+ action :delete
108
+ backup false
109
+ end
110
+
111
+ # enable mod_deflate for consistency across distributions
112
+ include_recipe "apache2::mod_deflate"
113
+ end
114
+
115
+ if platform?("freebsd")
116
+ file "#{node['apache']['dir']}/Includes/no-accf.conf" do
117
+ action :delete
118
+ backup false
119
+ end
120
+ directory "#{node['apache']['dir']}/Includes" do
121
+ action :delete
122
+ end
123
+
124
+ %w{httpd-autoindex.conf httpd-dav.conf httpd-default.conf httpd-info.conf
125
+ httpd-languages.conf httpd-manual.conf httpd-mpm.conf
126
+ httpd-multilang-errordoc.conf httpd-ssl.conf httpd-userdir.conf
127
+ httpd-vhosts.conf}.each do |f|
128
+ file "#{node['apache']['dir']}/extra/#{f}" do
129
+ action :delete
130
+ backup false
131
+ end
132
+ end
133
+ directory "#{node['apache']['dir']}/extra" do
134
+ action :delete
135
+ end
136
+ end
137
+
138
+ directory "#{node['apache']['dir']}/ssl" do
139
+ action :create
140
+ mode 0755
141
+ owner "root"
142
+ group node['apache']['root_group']
143
+ end
144
+
145
+ directory "#{node['apache']['dir']}/conf.d" do
146
+ action :create
147
+ mode 0755
148
+ owner "root"
149
+ group node['apache']['root_group']
150
+ end
151
+
152
+ directory node['apache']['cache_dir'] do
153
+ action :create
154
+ mode 0755
155
+ owner "root"
156
+ group node['apache']['root_group']
157
+ end
158
+
159
+ template "apache2.conf" do
160
+ case node['platform']
161
+ when "redhat", "centos", "scientific", "fedora", "arch", "amazon"
162
+ path "#{node['apache']['dir']}/conf/httpd.conf"
163
+ when "debian","ubuntu"
164
+ path "#{node['apache']['dir']}/apache2.conf"
165
+ when "freebsd"
166
+ path "#{node['apache']['dir']}/httpd.conf"
167
+ end
168
+ source "apache2.conf.erb"
169
+ owner "root"
170
+ group node['apache']['root_group']
171
+ mode 0644
172
+ notifies :restart, resources(:service => "apache2")
173
+ end
174
+
175
+ template "security" do
176
+ path "#{node['apache']['dir']}/conf.d/security"
177
+ source "security.erb"
178
+ owner "root"
179
+ group node['apache']['root_group']
180
+ mode 0644
181
+ backup false
182
+ notifies :restart, resources(:service => "apache2")
183
+ end
184
+
185
+ template "charset" do
186
+ path "#{node['apache']['dir']}/conf.d/charset"
187
+ source "charset.erb"
188
+ owner "root"
189
+ group node['apache']['root_group']
190
+ mode 0644
191
+ backup false
192
+ notifies :restart, resources(:service => "apache2")
193
+ end
194
+
195
+ template "#{node['apache']['dir']}/ports.conf" do
196
+ source "ports.conf.erb"
197
+ owner "root"
198
+ group node['apache']['root_group']
199
+ variables :apache_listen_ports => node['apache']['listen_ports'].map{|p| p.to_i}.uniq
200
+ mode 0644
201
+ notifies :restart, resources(:service => "apache2")
202
+ end
203
+
204
+ template "#{node['apache']['dir']}/sites-available/default" do
205
+ source "default-site.erb"
206
+ owner "root"
207
+ group node['apache']['root_group']
208
+ mode 0644
209
+ notifies :restart, resources(:service => "apache2")
210
+ end
211
+
212
+ node['apache']['default_modules'].each do |mod|
213
+ recipe_name = mod =~ /^mod_/ ? mod : "mod_#{mod}"
214
+ include_recipe "apache2::#{recipe_name}"
215
+ end
216
+
217
+ apache_site "default" if node['apache']['default_site_enabled']
218
+
219
+ service "apache2" do
220
+ action :start
221
+ end
@@ -0,0 +1,33 @@
1
+ #
2
+ # Cookbook Name:: apache2
3
+ # Recipe:: god_monitor
4
+ #
5
+ # Copyright 2008-2009, Opscode, Inc.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+
20
+ apache_service = service "apache2" do
21
+ action :nothing
22
+ end
23
+
24
+ start_command = apache_service.start_command
25
+ stop_command = apache_service.stop_command
26
+ restart_command = apache_service.restart_command
27
+
28
+ god_monitor "apache2" do
29
+ config "apache2.god.erb"
30
+ start (start_command)?start_command : "/etc/init.d/#{apache_service.service_name} start"
31
+ restart (restart_command)?restart_command : "/etc/init.d/#{apache_service.service_name} restart"
32
+ stop (stop_command)?stop_command : "/etc/init.d/#{apache_service.service_name} stop"
33
+ end
@@ -0,0 +1,22 @@
1
+ #
2
+ # Cookbook Name:: apache2
3
+ # Recipe:: alias
4
+ #
5
+ # Copyright 2008-2009, Opscode, Inc.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+
20
+ apache_module "alias" do
21
+ conf true
22
+ end
@@ -0,0 +1,45 @@
1
+ #
2
+ # Cookbook Name:: apache2
3
+ # Recipe:: apreq2
4
+ #
5
+ # modified from the python recipe by Jeremy Bingham
6
+ #
7
+ # Copyright 2008-2009, Opscode, Inc.
8
+ #
9
+ # Licensed under the Apache License, Version 2.0 (the "License");
10
+ # you may not use this file except in compliance with the License.
11
+ # You may obtain a copy of the License at
12
+ #
13
+ # http://www.apache.org/licenses/LICENSE-2.0
14
+ #
15
+ # Unless required by applicable law or agreed to in writing, software
16
+ # distributed under the License is distributed on an "AS IS" BASIS,
17
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ # See the License for the specific language governing permissions and
19
+ # limitations under the License.
20
+ #
21
+
22
+ case node['platform']
23
+ when "debian", "ubuntu"
24
+ package "libapache2-mod-apreq2" do
25
+ action :install
26
+ end
27
+ when "centos", "redhat", "fedora", "amazon", "scientific"
28
+ package "libapreq2" do
29
+ action :install
30
+ notifies :run, resources(:execute => "generate-module-list"), :immediately
31
+ end
32
+ # seems that the apreq lib is weirdly broken or something - it needs to be
33
+ # loaded as "apreq", but on RHEL & derivitatives the file needs a symbolic
34
+ # link to mod_apreq.so.
35
+ link "/usr/lib64/httpd/modules/mod_apreq.so" do
36
+ to "/usr/lib64/httpd/modules/mod_apreq2.so"
37
+ only_if "test -f /usr/lib64/httpd/modules/mod_apreq2.so"
38
+ end
39
+ link "/usr/lib/httpd/modules/mod_apreq.so" do
40
+ to "/usr/lib/httpd/modules/mod_apreq2.so"
41
+ only_if "test -f /usr/lib/httpd/modules/mod_apreq2.so"
42
+ end
43
+ end
44
+
45
+ apache_module "apreq"
@@ -0,0 +1,20 @@
1
+ #
2
+ # Cookbook Name:: apache2
3
+ # Recipe:: auth_basic
4
+ #
5
+ # Copyright 2008-2009, Opscode, Inc.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+
20
+ apache_module "auth_basic"
@@ -0,0 +1,20 @@
1
+ #
2
+ # Cookbook Name:: apache2
3
+ # Recipe:: auth_digest
4
+ #
5
+ # Copyright 2008-2009, Opscode, Inc.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+
20
+ apache_module "auth_digest"
@@ -0,0 +1,113 @@
1
+ #
2
+ # Cookbook Name:: apache2
3
+ # Recipe:: mod_auth_openid
4
+ #
5
+ # Copyright 2008-2009, Opscode, Inc.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+
20
+ openid_dev_pkgs = value_for_platform(
21
+ ["ubuntu","debian"] => { "default" => %w{ g++ apache2-prefork-dev libopkele-dev libopkele3 } },
22
+ ["centos","redhat","scientific","fedora","amazon"] => {
23
+ "default" => %w{ gcc-c++ httpd-devel curl-devel libtidy libtidy-devel sqlite-devel pcre-devel openssl-devel make }
24
+ },
25
+ "arch" => { "default" => ["libopkele"] },
26
+ "freebsd" => { "default" => %w{libopkele pcre sqlite3} }
27
+ )
28
+
29
+ make_cmd = value_for_platform(
30
+ "freebsd" => { "default" => "gmake" },
31
+ "default" => "make"
32
+ )
33
+
34
+ case node['platform']
35
+ when "arch"
36
+ include_recipe "pacman"
37
+ package "tidyhtml"
38
+ end
39
+
40
+ openid_dev_pkgs.each do |pkg|
41
+ case node['platform']
42
+ when "arch"
43
+ pacman_aur pkg do
44
+ action [:build, :install]
45
+ end
46
+ else
47
+ package pkg
48
+ end
49
+ end
50
+
51
+ case node['platform']
52
+ when "redhat", "centos", "scientific", "fedora", "amazon"
53
+ remote_file "#{Chef::Config['file_cache_path']}/libopkele-2.0.4.tar.gz" do
54
+ source "http://kin.klever.net/dist/libopkele-2.0.4.tar.gz"
55
+ mode 0644
56
+ end
57
+
58
+ bash "install libopkele" do
59
+ cwd Chef::Config['file_cache_path']
60
+ # Ruby 1.8.6 does not have rpartition, unfortunately
61
+ syslibdir = node['apache']['lib_dir'][0..node['apache']['lib_dir'].rindex("/")]
62
+ code <<-EOH
63
+ tar zxvf libopkele-2.0.4.tar.gz
64
+ cd libopkele-2.0.4 && ./configure --prefix=/usr --libdir=#{syslibdir}
65
+ #{make_cmd} && #{make_cmd} install
66
+ EOH
67
+ not_if { File.exists?("#{syslibdir}/libopkele.a") }
68
+ end
69
+ end
70
+
71
+ _checksum = node['apache']['mod_auth_openid']['checksum']
72
+ version = node['apache']['mod_auth_openid']['version']
73
+ configure_flags = node['apache']['mod_auth_openid']['configure_flags']
74
+
75
+ remote_file "#{Chef::Config['file_cache_path']}/mod_auth_openid-#{version}.tar.gz" do
76
+ source "http://butterfat.net/releases/mod_auth_openid/mod_auth_openid-#{version}.tar.gz"
77
+ mode 0644
78
+ checksum _checksum
79
+ end
80
+
81
+ bash "install mod_auth_openid" do
82
+ cwd Chef::Config['file_cache_path']
83
+ code <<-EOH
84
+ tar zxvf mod_auth_openid-#{version}.tar.gz
85
+ cd mod_auth_openid-#{version} && ./configure #{configure_flags.join(' ')}
86
+ perl -pi -e "s/-i -a -n 'authopenid'/-i -n 'authopenid'/g" Makefile
87
+ #{make_cmd} && #{make_cmd} install
88
+ EOH
89
+ not_if { ::File.exists?("#{node['apache']['libexecdir']}/mod_auth_openid.so") }
90
+ end
91
+
92
+ directory node['apache']['mod_auth_openid']['cache_dir'] do
93
+ owner node['apache']['user']
94
+ group node['apache']['group']
95
+ mode 0700
96
+ end
97
+
98
+ file node['apache']['mod_auth_openid']['dblocation'] do
99
+ owner node['apache']['user']
100
+ group node['apache']['group']
101
+ mode 0644
102
+ end
103
+
104
+ template "#{node['apache']['dir']}/mods-available/authopenid.load" do
105
+ source "mods/authopenid.load.erb"
106
+ owner "root"
107
+ group node['apache']['root_group']
108
+ mode 0644
109
+ end
110
+
111
+ apache_module "authopenid" do
112
+ filename "mod_auth_openid.so"
113
+ end