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,373 @@
1
+ Description
2
+ ===========
3
+
4
+ This cookbook provides a complete Debian/Ubuntu style Apache HTTPD configuration. Non-Debian based distributions such as Red Hat/CentOS, ArchLinux and others supported by this cookbook will have a configuration that mimics Debian/Ubuntu style as it is easier to manage with Chef.
5
+
6
+ Debian-style Apache configuration uses scripts to manage modules and sites (vhosts). The scripts are:
7
+
8
+ * a2ensite
9
+ * a2dissite
10
+ * a2enmod
11
+ * a2dismod
12
+
13
+ This cookbook ships with templates of these scripts for non Debian/Ubuntu platforms. The scripts are used in the __Definitions__ below.
14
+
15
+ Requirements
16
+ ============
17
+
18
+ ## Cookbooks:
19
+
20
+ This cookbook doesn't have direct dependencies on other cookbooks. Depending on your OS configuration and security policy, you may need additional recipes or cookbooks for this cookbook's recipes to converge on the node. In particular, the following Operating System nuances may affect the behavior:
21
+
22
+ * apt cache outdated
23
+ * SELinux enabled
24
+ * IPtables
25
+ * Compile tools
26
+
27
+ On Ubuntu/Debian, use Opscode's `apt` cookbook to ensure the package cache is updated so Chef can install packages, or consider putting apt-get in your bootstrap process or [knife bootstrap template](http://wiki.opscode.com/display/chef/Knife+Bootstrap).
28
+
29
+ On RHEL, SELinux is enabled by default. The `selinux` cookbook contains a `permissive` recipe that can be used to set SELinux to "Permissive" state. Otherwise, additional recipes need to be created by the user to address SELinux permissions.
30
+
31
+ The easiest but **certainly not ideal way** to deal with IPtables is to flush all rules. Opscode does provide an `iptables` cookbook but is migrating from the approach used there to a more robust solution utilizing a general "firewall" LWRP that would have an "iptables" provider. Alternately, you can use ufw, with Opscode's `ufw` and `firewall` cookbooks to set up rules. See those cookbooks' READMEs for documentation.
32
+
33
+ Build/compile tools may not be installed on the system by default. Some recipes (e.g., `apache2::mod_auth_openid`) build the module from source. Use Opscode's `build-essential` cookbook to get essential build packages installed.
34
+
35
+ On ArchLinux, if you are using the `apache2::mod_auth_openid` recipe, you also need the `pacman` cookbook for the `pacman_aur` LWRP. Put `recipe[pacman]` on the node's expanded run list (on the node or in a role). This is not an explicit dependency because it is only required for this single recipe and platform; the pacman default recipe performs `pacman -Sy` to keep pacman's package cache updated.
36
+
37
+ The `apache2::god_monitor` recipe uses a definition from the `god` cookbook. Include `recipe[god]` in the node's expanded run list to ensure that the cookbook is downloaded.
38
+
39
+ ## Platforms:
40
+
41
+ * Debian
42
+ * Ubuntu
43
+ * Red Hat/CentOS/Scientific Linux/Fedora (RHEL Family)
44
+ * SUSE/OpenSUSE
45
+ * ArchLinux
46
+ * Amazon Linux AMI
47
+ * FreeBSD
48
+
49
+ ### Notes for RHEL Family:
50
+
51
+ On Red Hat Enterprise Linux and derivatives, the EPEL repository may be necessary to install packages used in certain recipes. The `apache2::default` recipe, however, does not require any additional repositories. Opscode's `yum` cookbook contains a recipe to add the EPEL repository. See __Examples__ for more information.
52
+
53
+ ### Notes for FreeBSD:
54
+
55
+ The `apache2::mod_php5` recipe depends on the `freebsd` cookbook, which it uses to set the correct options for compiling the `php5` port from sources. You need to ensure the `freebsd` is in the expanded run list, or this recipe will fail. We don't set an explicit dependency because we feel the `freebsd` cookbook is something users would want on their nodes, and due to the generality of this cookbook we don't want additional specific dependencies.
56
+
57
+ Tests
58
+ =====
59
+
60
+ This cookbook in the [source repository](https://github.com/opscode-cookbooks/apache2) contains minitest and cucumber tests. This is an initial proof of concept that will be fleshed out with more supporting infrastructure at a future time.
61
+
62
+ Attributes
63
+ ==========
64
+
65
+ This cookbook uses many attributes, broken up into a few different kinds.
66
+
67
+ Platform specific
68
+ -----------------
69
+
70
+ In order to support the broadest number of platforms, several attributes are determined based on the node's platform. See the attributes/default.rb file for default values in the case statement at the top of the file.
71
+
72
+ * `node['apache']['dir']` - Location for the Apache configuration
73
+ * `node['apache']['log_dir']` - Location for Apache logs
74
+ * `node['apache']['user']` - User Apache runs as
75
+ * `node['apache']['group']` - Group Apache runs as
76
+ * `node['apache']['binary']` - Apache httpd server daemon
77
+ * `node['apache']['icondir']` - Location for icons
78
+ * `node['apache']['cache_dir']` - Location for cached files used by Apache itself or recipes
79
+ * `node['apache']['pid_file']` - Location of the PID file for Apache httpd
80
+ * `node['apache']['lib_dir']` - Location for shared libraries
81
+ * `node['apache']['default_site_enabled']` - Default site enabled. Defaults to true on redhat-family platforms
82
+ * `node['apache']['ext_status']` - if true, enables ExtendedStatus for `mod_status`
83
+
84
+ General settings
85
+ ----------------
86
+
87
+ These are general settings used in recipes and templates. Default values are noted.
88
+
89
+ * `node['apache']['listen_ports']` - Ports that httpd should listen on. Default is an array of ports 80 and 443.
90
+ * `node['apache']['contact']` - Value for ServerAdmin directive. Default "ops@example.com".
91
+ * `node['apache']['timeout']` - Value for the Timeout directive. Default is 300.
92
+ * `node['apache']['keepalive']` - Value for the KeepAlive directive. Default is On.
93
+ * `node['apache']['keepaliverequests']` - Value for MaxKeepAliveRequests. Default is 100.
94
+ * `node['apache']['keepalivetimeout']` - Value for the KeepAliveTimeout directive. Default is 5.
95
+ * `node['apache']['default_modules']` - Array of module names. Can take "mod_FOO" or "FOO" as names, where FOO is the apache module, e.g. "`mod_status`" or "`status`".
96
+
97
+ The modules listed in `default_modules` will be included as recipes in `recipe[apache::default]`.
98
+
99
+ Prefork attributes
100
+ ------------------
101
+
102
+ Prefork attributes are used for tuning the Apache HTTPD prefork MPM configuration.
103
+
104
+ * `node['apache']['prefork']['startservers']` - initial number of server processes to start. Default is 16.
105
+ * `node['apache']['prefork']['minspareservers']` - minimum number of spare server processes. Default 16.
106
+ * `node['apache']['prefork']['maxspareservers']` - maximum number of spare server processes. Default 32.
107
+ * `node['apache']['prefork']['serverlimit']` - upper limit on configurable server processes. Default 400.
108
+ * `node['apache']['prefork']['maxclients']` - Maximum number of simultaneous connections.
109
+ * `node['apache']['prefork']['maxrequestsperchild']` - Maximum number of request a child process will handle. Default 10000.
110
+
111
+ Worker attributes
112
+ -----------------
113
+
114
+ Worker attributes are used for tuning the Apache HTTPD worker MPM configuration.
115
+
116
+ * `node['apache']['worker']['startservers']` - Initial number of server processes to start. Default 4
117
+ * `node['apache']['worker']['maxclients']` - Maximum number of simultaneous connections. Default 1024.
118
+ * `node['apache']['worker']['minsparethreads']` - Minimum number of spare worker threads. Default 64
119
+ * `node['apache']['worker']['maxsparethreads']` - Maximum number of spare worker threads. Default 192.
120
+ * `node['apache']['worker']['maxrequestsperchild']` - Maximum number of requests a child process will handle.
121
+
122
+ mod\_auth\_openid attributes
123
+ ----------------------------
124
+
125
+ The following attributes are in the `attributes/mod_auth_openid.rb` file. Like all Chef attributes files, they are loaded as well, but they're logistically unrelated to the others, being specific to the `mod_auth_openid` recipe.
126
+
127
+ * `node['apache']['mod_auth_openid']['checksum']` - sha256sum of the tarball containing the source.
128
+ * `node['apache']['mod_auth_openid']['version']` - version of the `mod_auth_openid` to download.
129
+ * `node['apache']['mod_auth_openid']['cache_dir']` - the cache directory is where the sqlite3 database is stored. It is separate so it can be managed as a directory resource.
130
+ * `node['apache']['mod_auth_openid']['dblocation']` - filename of the sqlite3 database used for directive `AuthOpenIDDBLocation`, stored in the `cache_dir` by default.
131
+ * `node['apache']['mod_auth_openid']['configure_flags']` - optional array of configure flags passed to the `./configure` step in the compilation of the module.
132
+
133
+ Recipes
134
+ =======
135
+
136
+ Most of the recipes in the cookbook are for enabling Apache modules. Where additional configuration or behavior is used, it is documented below in more detail.
137
+
138
+ The following recipes merely enable the specified module: `mod_alias`, `mod_basic`, `mod_digest`, `mod_authn_file`, `mod_authnz_ldap`, `mod_authz_default`, `mod_authz_groupfile`, `mod_authz_host`, `mod_authz_user`, `mod_autoindex`, `mod_cgi`, `mod_dav_fs`, `mod_dav_svn`, `mod_deflate`, `mod_dir`, `mod_env`, `mod_expires`, `mod_headers`, `mod_ldap`, `mod_log_config`, `mod_mime`, `mod_negotiation`, `mod_proxy`, `mod_proxy_ajp`, `mod_proxy_balancer`, `mod_proxy_connect`, `mod_proxy_http`, `mod_python`, `mod_rewrite`, `mod_setenvif`, `mod_status`, `mod_wsgi`, `mod_xsendfile`.
139
+
140
+ On RHEL Family distributions, certain modules ship with a config file with the package. The recipes here may delete those configuration files to ensure they don't conflict with the settings from the cookbook, which will use per-module configuration in `/etc/httpd/mods-enabled`.
141
+
142
+ default
143
+ -------
144
+
145
+ The default recipe does a number of things to set up Apache HTTPd. It also includes a number of modules based on the attribute `node['apache']['default_modules']` as recipes.
146
+
147
+ mod\_auth\_openid
148
+ -----------------
149
+
150
+ **Changed via COOK-915**
151
+
152
+ This recipe compiles the module from source. In addition to `build-essential`, some other packages are included for installation like the GNU C++ compiler and development headers.
153
+
154
+ To use the module in your own cookbooks to authenticate systems using OpenIDs, specify an array of OpenIDs that are allowed to authenticate with the attribute `node['apache']['allowed_openids']`. Use the following in a vhost to protect with OpenID authentication:
155
+
156
+ AuthType OpenID
157
+ require user <%= node['apache']['allowed_openids'].join(' ') %>
158
+ AuthOpenIDDBLocation <%= node['apache']['mod_auth_openid']['dblocation'] %>
159
+
160
+ Change the DBLocation with the attribute as required; this file is in a different location than previous versions, see below. It should be a sane default for most platforms, though, see `attributes/mod_auth_openid.rb`.
161
+
162
+ ### Changes from COOK-915:
163
+
164
+ * `AuthType OpenID` instead of `AuthOpenIDEnabled On`.
165
+ * `require user` instead of `AuthOpenIDUserProgram`.
166
+ * A bug(?) in `mod_auth_openid` causes it to segfault when attempting to update the database file if the containing directory is not writable by the HTTPD process owner (e.g., www-data), even if the file is writable. In order to not interfere with other settings from the default recipe in this cookbook, the db file is moved.
167
+
168
+ mod\_fastcgi
169
+ ------------
170
+
171
+ Install the fastcgi package and enable the module.
172
+
173
+ Only work on Debian/Ubuntu
174
+
175
+ mod\_fcgid
176
+ ----------
177
+
178
+ Installs the fcgi package and enables the module. Requires EPEL on RHEL family.
179
+
180
+ On RHEL family, this recipe will delete the fcgid.conf and on version 6+, create the /var/run/httpd/mod_fcgid` directory, which prevents the emergency error:
181
+
182
+ [emerg] (2)No such file or directory: mod_fcgid: Can't create shared memory for size XX bytes
183
+
184
+ mod\_php5
185
+ --------
186
+
187
+ Simply installs the appropriate package on Debian, Ubuntu and ArchLinux.
188
+
189
+ On Red Hat family distributions including Fedora, the php.conf that comes with the package is removed. On RHEL platforms less than v6, the `php53` package is used.
190
+
191
+ mod\_ssl
192
+ --------
193
+
194
+ Besides installing and enabling `mod_ssl`, this recipe will append port 443 to the `node['apache']['listen_ports']` attribute array and update the ports.conf.
195
+
196
+ god\_monitor
197
+ ------------
198
+
199
+ Sets up a `god` monitor for Apache. External requirements are the `god` and `runit` cookbooks from Opscode. When using this recipe, include `recipe[god]` in the node's expanded run list to ensure the client downloads it; `god` depends on runit so that will also be downloaded.
200
+
201
+ Definitions
202
+ ===========
203
+
204
+ The cookbook provides a few definitions. At some point in the future these definitions may be refactored into lightweight resources and providers.
205
+
206
+ apache\_conf
207
+ ------------
208
+
209
+ Sets up configuration file for an Apache module from a template. The template should be in the same cookbook where the definition is used. This is used by the `apache_module` definition and is not often used directly.
210
+
211
+ This will use a template resource to write the module's configuration file in the `mods-available` under the Apache configuration directory (`node['apache']['dir']`). This is a platform-dependent location. See __apache\_module__.
212
+
213
+ ### Parameters:
214
+
215
+ * `name` - Name of the template. When used from the `apache_module`, it will use the same name as the module.
216
+
217
+ ### Examples:
218
+
219
+ Create `#{node['apache']['dir']}/mods-available/alias.conf`.
220
+
221
+ apache_conf "alias"
222
+
223
+ apache\_module
224
+ --------------
225
+
226
+ Enable or disable an Apache module in `#{node['apache']['dir']}/mods-available` by calling `a2enmod` or `a2dismod` to manage the symbolic link in `#{node['apache']['dir']}/mods-enabled`. If the module has a configuration file, a template should be created in the cookbook where the definition is used. See __Examples__.
227
+
228
+ ### Parameters:
229
+
230
+ * `name` - Name of the module enabled or disabled with the `a2enmod` or `a2dismod` scripts.
231
+ * `enable` - Default true, which uses `a2enmod` to enable the module. If false, the module will be disabled with `a2dismod`.
232
+ * `conf` - Default false. Set to true if the module has a config file, which will use `apache_conf` for the file.
233
+ * `filename` - specify the full name of the file, e.g.
234
+
235
+ ### Examples:
236
+
237
+ Enable the ssl module, which also has a configuration template in `templates/default/ssl.conf.erb`.
238
+
239
+ apache_module "ssl" do
240
+ conf true
241
+ end
242
+
243
+ Enable the php5 module, which has a different filename than the module default:
244
+
245
+ apache_module "php5" do
246
+ filename "libphp5.so"
247
+ end
248
+
249
+ Disable a module:
250
+
251
+ apache_module "disabled_module" do
252
+ enable false
253
+ end
254
+
255
+ See the recipes directory for many more examples of `apache_module`.
256
+
257
+ apache\_site
258
+ ------------
259
+
260
+ Enable or disable a VirtualHost in `#{node['apache']['dir']}/sites-available` by calling a2ensite or a2dissite to manage the symbolic link in `#{node['apache']['dir']}/sites-enabled`.
261
+
262
+ The template for the site must be managed as a separate resource. To combine the template with enabling a site, see `web_app`.
263
+
264
+ ### Parameters:
265
+
266
+ * `name` - Name of the site.
267
+ * `enable` - Default true, which uses `a2ensite` to enable the site. If false, the site will be disabled with `a2dissite`.
268
+
269
+ web\_app
270
+ --------
271
+
272
+ Manage a template resource for a VirtualHost site, and enable it with `apache_site`. This is commonly done for managing web applications such as Ruby on Rails, PHP or Django, and the default behavior reflects that. However it is flexible.
273
+
274
+ This definition includes some recipes to make sure the system is configured to have Apache and some sane default modules:
275
+
276
+ * `apache2`
277
+ * `apache2::mod_rewrite`
278
+ * `apache2::mod_deflate`
279
+ * `apache2::mod_headers`
280
+
281
+ It will then configure the template (see __Parameters__ and __Examples__ below), and enable or disable the site per the `enable` parameter.
282
+
283
+ ### Parameters:
284
+
285
+ Current parameters used by the definition:
286
+
287
+ * `name` - The name of the site. The template will be written to `#{node['apache']['dir']}/sites-available/#{params['name']}.conf`
288
+ * `cookbook` - Optional. Cookbook where the source template is. If this is not defined, Chef will use the named template in the cookbook where the definition is used.
289
+ * `template` - Default `web_app.conf.erb`, source template file.
290
+ * `enable` - Default true. Passed to the `apache_site` definition.
291
+
292
+ Additional parameters can be defined when the definition is called in a recipe, see __Examples__.
293
+
294
+ ### Examples:
295
+
296
+ All parameters are passed into the template. You can use whatever you like. The apache2 cookbook comes with a `web_app.conf.erb` template as an example. The following parameters are used in the template:
297
+
298
+ * `server_name` - ServerName directive.
299
+ * `server_aliases` - ServerAlias directive. Must be an array of aliases.
300
+ * `docroot` - DocumentRoot directive.
301
+ * `application_name` - Used in RewriteLog directive. Will be set to the `name` parameter.
302
+
303
+ To use the default web_app, for example:
304
+
305
+ web_app "my_site" do
306
+ server_name node['hostname']
307
+ server_aliases [node['fqdn'], "my-site.example.com"]
308
+ docroot "/srv/www/my_site"
309
+ end
310
+
311
+ The parameters specified will be used as:
312
+
313
+ * `@params[:server_name]`
314
+ * `@params[:server_aliases]`
315
+ * `@params[:docroot]`
316
+
317
+ In the template. When you write your own, the `@` is significant.
318
+
319
+ For more information about Definitions and parameters, see the [Chef Wiki](http://wiki.opscode.com/display/chef/Definitions)
320
+
321
+ Usage
322
+ =====
323
+
324
+ Using this cookbook is relatively straightforward. Add the desired recipes to the run list of a node, or create a role. Depending on your environment, you may have multiple roles that use different recipes from this cookbook. Adjust any attributes as desired. For example, to create a basic role for web servers that provide both HTTP and HTTPS:
325
+
326
+ % cat roles/webserver.rb
327
+ name "webserver"
328
+ description "Systems that serve HTTP and HTTPS"
329
+ run_list(
330
+ "recipe[apache2]",
331
+ "recipe[apache2::mod_ssl]"
332
+ )
333
+ default_attributes(
334
+ "apache2" => {
335
+ "listen_ports" => ["80", "443"]
336
+ }
337
+ )
338
+
339
+ For examples of using the definitions in your own recipes, see their respective sections above.
340
+
341
+ License and Authors
342
+ ===================
343
+
344
+ Author:: Adam Jacob <adam@opscode.com>
345
+ Author:: Joshua Timberman <joshua@opscode.com>
346
+ Author:: Bryan McLellan <bryanm@widemile.com>
347
+ Author:: Dave Esposito <esposito@espolinux.corpnet.local>
348
+ Author:: David Abdemoulaie <github@hobodave.com>
349
+ Author:: Edmund Haselwanter <edmund@haselwanter.com>
350
+ Author:: Eric Rochester <err8n@virginia.edu>
351
+ Author:: Jim Browne <jbrowne@42lines.net>
352
+ Author:: Matthew Kent <mkent@magoazul.com>
353
+ Author:: Nathen Harvey <nharvey@customink.com>
354
+ Author:: Ringo De Smet <ringo.de.smet@amplidata.com>
355
+ Author:: Sean OMeara <someara@opscode.com>
356
+ Author:: Seth Chisamore <schisamo@opscode.com>
357
+ Author:: Gilles Devaux <gilles@peerpong.com>
358
+
359
+ Copyright:: 2009-2011, Opscode, Inc
360
+ Copyright:: 2011, Atriso
361
+ Copyright:: 2011, CustomInk, LLC.
362
+
363
+ Licensed under the Apache License, Version 2.0 (the "License");
364
+ you may not use this file except in compliance with the License.
365
+ You may obtain a copy of the License at
366
+
367
+ http://www.apache.org/licenses/LICENSE-2.0
368
+
369
+ Unless required by applicable law or agreed to in writing, software
370
+ distributed under the License is distributed on an "AS IS" BASIS,
371
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
372
+ See the License for the specific language governing permissions and
373
+ limitations under the License.
@@ -0,0 +1,149 @@
1
+ #
2
+ # Cookbook Name:: apache2
3
+ # Attributes:: apache
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
+ set['apache']['root_group'] = "root"
21
+
22
+ # Where the various parts of apache are
23
+ case platform
24
+ when "redhat","centos","scientific","fedora","suse","amazon"
25
+ set['apache']['package'] = "httpd"
26
+ set['apache']['dir'] = "/etc/httpd"
27
+ set['apache']['log_dir'] = "/var/log/httpd"
28
+ set['apache']['error_log'] = "error.log"
29
+ set['apache']['user'] = "apache"
30
+ set['apache']['group'] = "apache"
31
+ set['apache']['binary'] = "/usr/sbin/httpd"
32
+ set['apache']['icondir'] = "/var/www/icons"
33
+ set['apache']['cache_dir'] = "/var/cache/httpd"
34
+ if node['platform_version'].to_f >= 6 then
35
+ set['apache']['pid_file'] = "/var/run/httpd/httpd.pid"
36
+ else
37
+ set['apache']['pid_file'] = "/var/run/httpd.pid"
38
+ end
39
+ set['apache']['lib_dir'] = node['kernel']['machine'] =~ /^i[36']86$/ ? "/usr/lib/httpd" : "/usr/lib64/httpd"
40
+ set['apache']['libexecdir'] = "#{set['apache']['lib_dir']}/modules"
41
+ set['apache']['default_site_enabled'] = true
42
+ when "debian","ubuntu"
43
+ set['apache']['package'] = "apache2"
44
+ set['apache']['dir'] = "/etc/apache2"
45
+ set['apache']['log_dir'] = "/var/log/apache2"
46
+ set['apache']['error_log'] = "error.log"
47
+ set['apache']['user'] = "www-data"
48
+ set['apache']['group'] = "www-data"
49
+ set['apache']['binary'] = "/usr/sbin/apache2"
50
+ set['apache']['icondir'] = "/usr/share/apache2/icons"
51
+ set['apache']['cache_dir'] = "/var/cache/apache2"
52
+ set['apache']['pid_file'] = "/var/run/apache2.pid"
53
+ set['apache']['lib_dir'] = "/usr/lib/apache2"
54
+ set['apache']['libexecdir'] = "#{set['apache']['lib_dir']}/modules"
55
+ set['apache']['default_site_enabled'] = false
56
+ when "arch"
57
+ set['apache']['package'] = "apache"
58
+ set['apache']['dir'] = "/etc/httpd"
59
+ set['apache']['log_dir'] = "/var/log/httpd"
60
+ set['apache']['error_log'] = "error.log"
61
+ set['apache']['user'] = "http"
62
+ set['apache']['group'] = "http"
63
+ set['apache']['binary'] = "/usr/sbin/httpd"
64
+ set['apache']['icondir'] = "/usr/share/httpd/icons"
65
+ set['apache']['cache_dir'] = "/var/cache/httpd"
66
+ set['apache']['pid_file'] = "/var/run/httpd/httpd.pid"
67
+ set['apache']['lib_dir'] = "/usr/lib/httpd"
68
+ set['apache']['libexecdir'] = "#{set['apache']['lib_dir']}/modules"
69
+ set['apache']['default_site_enabled'] = false
70
+ when "freebsd"
71
+ set['apache']['package'] = "apache22"
72
+ set['apache']['dir'] = "/usr/local/etc/apache22"
73
+ set['apache']['log_dir'] = "/var/log"
74
+ set['apache']['error_log'] = "httpd-error.log"
75
+ set['apache']['root_group'] = "wheel"
76
+ set['apache']['user'] = "www"
77
+ set['apache']['group'] = "www"
78
+ set['apache']['binary'] = "/usr/local/sbin/httpd"
79
+ set['apache']['icondir'] = "/usr/local/www/apache22/icons"
80
+ set['apache']['cache_dir'] = "/var/run/apache22"
81
+ set['apache']['pid_file'] = "/var/run/httpd.pid"
82
+ set['apache']['lib_dir'] = "/usr/local/libexec/apache22"
83
+ set['apache']['libexecdir'] = set['apache']['lib_dir']
84
+ set['apache']['default_site_enabled'] = false
85
+ else
86
+ set['apache']['dir'] = "/etc/apache2"
87
+ set['apache']['log_dir'] = "/var/log/apache2"
88
+ set['apache']['error_log'] = "error.log"
89
+ set['apache']['user'] = "www-data"
90
+ set['apache']['group'] = "www-data"
91
+ set['apache']['binary'] = "/usr/sbin/apache2"
92
+ set['apache']['icondir'] = "/usr/share/apache2/icons"
93
+ set['apache']['cache_dir'] = "/var/cache/apache2"
94
+ set['apache']['pid_file'] = "logs/httpd.pid"
95
+ set['apache']['lib_dir'] = "/usr/lib/apache2"
96
+ set['apache']['libexecdir'] = "#{set['apache']['lib_dir']}/modules"
97
+ set['apache']['default_site_enabled'] = false
98
+ end
99
+
100
+ ###
101
+ # These settings need the unless, since we want them to be tunable,
102
+ # and we don't want to override the tunings.
103
+ ###
104
+
105
+ # General settings
106
+ default['apache']['listen_ports'] = [ "80" ]
107
+ default['apache']['contact'] = "ops@example.com"
108
+ default['apache']['timeout'] = 300
109
+ default['apache']['keepalive'] = "On"
110
+ default['apache']['keepaliverequests'] = 100
111
+ default['apache']['keepalivetimeout'] = 5
112
+
113
+ # Security
114
+ default['apache']['servertokens'] = "Prod"
115
+ default['apache']['serversignature'] = "On"
116
+ default['apache']['traceenable'] = "On"
117
+
118
+ # mod_auth_openids
119
+ default['apache']['allowed_openids'] = Array.new
120
+
121
+ # mod_status ExtendedStatus, set to 'true' to enable
122
+ default['apache']['ext_status'] = false
123
+
124
+ # Prefork Attributes
125
+ default['apache']['prefork']['startservers'] = 16
126
+ default['apache']['prefork']['minspareservers'] = 16
127
+ default['apache']['prefork']['maxspareservers'] = 32
128
+ default['apache']['prefork']['serverlimit'] = 400
129
+ default['apache']['prefork']['maxclients'] = 400
130
+ default['apache']['prefork']['maxrequestsperchild'] = 10000
131
+
132
+ # Worker Attributes
133
+ default['apache']['worker']['startservers'] = 4
134
+ default['apache']['worker']['maxclients'] = 1024
135
+ default['apache']['worker']['minsparethreads'] = 64
136
+ default['apache']['worker']['maxsparethreads'] = 192
137
+ default['apache']['worker']['threadsperchild'] = 64
138
+ default['apache']['worker']['maxrequestsperchild'] = 0
139
+
140
+ # Default modules to enable via include_recipe
141
+
142
+ default['apache']['default_modules'] = %w{
143
+ status alias auth_basic authn_file authz_default authz_groupfile authz_host authz_user autoindex
144
+ dir env mime negotiation setenvif
145
+ }
146
+
147
+ %w{ log_config logio }.each do |log_mod|
148
+ default['apache']['default_modules'] << log_mod if ["redhat", "centos", "scientific", "fedora", "suse", "arch", "freebsd", "amazon"].include?(node['platform'])
149
+ end
@@ -0,0 +1,32 @@
1
+ #
2
+ # Author:: Joshua Timberman <joshua@opscode.com>
3
+ # Copyright:: Copyright (c) 2011, Opscode, Inc.
4
+ # License:: Apache License, Version 2.0
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ default['apache']['mod_auth_openid']['checksum'] = "79e7ca52511d1230"
20
+ default['apache']['mod_auth_openid']['version'] = "0.6"
21
+ default['apache']['mod_auth_openid']['cache_dir'] = "/var/cache/mod_auth_openid"
22
+ default['apache']['mod_auth_openid']['dblocation'] = "#{node['apache']['mod_auth_openid']['cache_dir']}/mod_auth_openid.db"
23
+
24
+ case node['platform']
25
+ when "freebsd"
26
+ default['apache']['mod_auth_openid']['configure_flags'] = [
27
+ "CPPFLAGS=-I/usr/local/include",
28
+ "LDFLAGS=-I/usr/local/lib -lsqlite3"
29
+ ]
30
+ else
31
+ default['apache']['mod_auth_openid']['configure_flags'] = []
32
+ end
@@ -0,0 +1,26 @@
1
+ #
2
+ # Cookbook Name:: apache2
3
+ # Definition:: apache_conf
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
+ define :apache_conf do
21
+ template "#{node['apache']['dir']}/mods-available/#{params[:name]}.conf" do
22
+ source "mods/#{params[:name]}.conf.erb"
23
+ notifies :restart, resources(:service => "apache2")
24
+ mode 0644
25
+ end
26
+ end
@@ -0,0 +1,53 @@
1
+ #
2
+ # Cookbook Name:: apache2
3
+ # Definition:: apache_module
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
+ define :apache_module, :enable => true, :conf => false do
21
+ include_recipe "apache2"
22
+
23
+ params[:filename] = params[:filename] || "mod_#{params[:name]}.so"
24
+ params[:module_path] = params[:module_path] || "#{node['apache']['libexecdir']}/#{params[:filename]}"
25
+
26
+ if params[:conf]
27
+ apache_conf params[:name]
28
+ end
29
+
30
+ if platform?("redhat", "centos", "scientific", "fedora", "arch", "suse", "amazon", "freebsd")
31
+ file "#{node['apache']['dir']}/mods-available/#{params[:name]}.load" do
32
+ content "LoadModule #{params[:name]}_module #{params[:module_path]}\n"
33
+ mode 0644
34
+ end
35
+ end
36
+
37
+ if params[:enable]
38
+ execute "a2enmod #{params[:name]}" do
39
+ command "/usr/sbin/a2enmod #{params[:name]}"
40
+ notifies :restart, resources(:service => "apache2")
41
+ not_if do (::File.symlink?("#{node['apache']['dir']}/mods-enabled/#{params[:name]}.load") and
42
+ ((::File.exists?("#{node['apache']['dir']}/mods-available/#{params[:name]}.conf"))?
43
+ (::File.symlink?("#{node['apache']['dir']}/mods-enabled/#{params[:name]}.conf")):(true)))
44
+ end
45
+ end
46
+ else
47
+ execute "a2dismod #{params[:name]}" do
48
+ command "/usr/sbin/a2dismod #{params[:name]}"
49
+ notifies :restart, resources(:service => "apache2")
50
+ only_if do ::File.symlink?("#{node['apache']['dir']}/mods-enabled/#{params[:name]}.load") end
51
+ end
52
+ end
53
+ end