Permalink
Browse files

Adding opscode cookbooks

  • Loading branch information...
0 parents commit 1f10b2519b3f215ef0ec550913612436bf417eb3 @adamhjk adamhjk committed Jan 18, 2009
Showing with 4,590 additions and 0 deletions.
  1. +201 −0 LICENSE
  2. +12 −0 NOTICE
  3. +72 −0 apache2/attributes/apache.rb
  4. +36 −0 apache2/definitions/apache_module.rb
  5. +36 −0 apache2/definitions/apache_site.rb
  6. +41 −0 apache2/files/default/apache2_module_conf_generate.pl
  7. +141 −0 apache2/recipes/default.rb
  8. +20 −0 apache2/recipes/mod_alias.rb
  9. +20 −0 apache2/recipes/mod_auth_basic.rb
  10. +20 −0 apache2/recipes/mod_auth_digest.rb
  11. +20 −0 apache2/recipes/mod_authn_file.rb
  12. +20 −0 apache2/recipes/mod_authnz_ldap.rb
  13. +20 −0 apache2/recipes/mod_authz_default.rb
  14. +20 −0 apache2/recipes/mod_authz_groupfile.rb
  15. +20 −0 apache2/recipes/mod_authz_host.rb
  16. +20 −0 apache2/recipes/mod_authz_user.rb
  17. +20 −0 apache2/recipes/mod_autoindex.rb
  18. +20 −0 apache2/recipes/mod_cgi.rb
  19. +20 −0 apache2/recipes/mod_dav.rb
  20. +20 −0 apache2/recipes/mod_dav_svn.rb
  21. +20 −0 apache2/recipes/mod_deflate.rb
  22. +20 −0 apache2/recipes/mod_dir.rb
  23. +20 −0 apache2/recipes/mod_env.rb
  24. +20 −0 apache2/recipes/mod_expires.rb
  25. +35 −0 apache2/recipes/mod_fcgid.rb
  26. +20 −0 apache2/recipes/mod_headers.rb
  27. +20 −0 apache2/recipes/mod_ldap.rb
  28. +20 −0 apache2/recipes/mod_log_config.rb
  29. +20 −0 apache2/recipes/mod_mime.rb
  30. +20 −0 apache2/recipes/mod_negotiation.rb
  31. +20 −0 apache2/recipes/mod_php5.rb
  32. +20 −0 apache2/recipes/mod_proxy.rb
  33. +20 −0 apache2/recipes/mod_proxy_http.rb
  34. +22 −0 apache2/recipes/mod_python.rb
  35. +20 −0 apache2/recipes/mod_rewrite.rb
  36. +20 −0 apache2/recipes/mod_setenvif.rb
  37. +20 −0 apache2/recipes/mod_ssl.rb
  38. +20 −0 apache2/recipes/mod_status.rb
  39. +22 −0 apache2/templates/default/a2dismod.erb
  40. +29 −0 apache2/templates/default/a2dissite.erb
  41. +37 −0 apache2/templates/default/a2enmod.erb
  42. +38 −0 apache2/templates/default/a2ensite.erb
  43. +630 −0 apache2/templates/default/apache2.conf.erb
  44. +45 −0 apache2/templates/default/default-site.erb
  45. +2 −0 apache2/templates/default/port_apache.erb
  46. +6 −0 apache2/templates/default/ports.conf.erb
  47. +31 −0 apt/recipes/default.rb
  48. +43 −0 build-essential/recipes/default.rb
  49. 0 chef/recipes/default.rb
  50. +40 −0 chef/recipes/server.rb
  51. +2 −0 chef/templates/default/port_chef.erb
  52. +2 −0 chef/templates/default/port_couchdb.erb
  53. +3 −0 chef/templates/default/sv-chef-indexer-log-run.erb
  54. +3 −0 chef/templates/default/sv-chef-indexer-run.erb
  55. +3 −0 chef/templates/default/sv-chef-server-log-run.erb
  56. +3 −0 chef/templates/default/sv-chef-server-run.erb
  57. +3 −0 chef/templates/default/sv-stompserver-log-run.erb
  58. +3 −0 chef/templates/default/sv-stompserver-run.erb
  59. +44 −0 ec2/attributes/ec2_metadata.rb
  60. +38 −0 ec2/attributes/ec2_recipe_options.rb
  61. +19 −0 ec2/recipes/default.rb
  62. +28 −0 git/recipes/default.rb
  63. +34 −0 iptables/definitions/iptables_rule.rb
  64. +282 −0 iptables/files/default/rebuild-iptables
  65. +37 −0 iptables/recipes/default.rb
  66. +2 −0 iptables/templates/default/all_established.erb
  67. +2 −0 iptables/templates/default/all_icmp.erb
  68. +11 −0 java/files/default/java.seed
  69. +47 −0 java/recipes/default.rb
  70. +11 −0 jira/attributes/jira.rb
  71. +323 −0 jira/files/default/catalina.sh
  72. +48 −0 jira/files/default/startup.sh
  73. +98 −0 jira/recipes/default.rb
  74. +114 −0 jira/templates/default/entityengine.xml.erb
  75. +90 −0 jira/templates/default/server.xml.erb
  76. +5 −0 jira/templates/default/sv-jira-run.erb
  77. +23 −0 man/recipes/default.rb
  78. +41 −0 munin/recipes/default.rb
  79. +41 −0 munin/templates/default/munin-node.conf.erb
  80. +2 −0 munin/templates/default/port_munin.erb
  81. +1 −0 mysql/attributes/mysql_ec2.rb
  82. +34 −0 mysql/recipes/client.rb
  83. +20 −0 mysql/recipes/default.rb
  84. +64 −0 mysql/recipes/server.rb
  85. +3 −0 mysql/templates/default/port_mysql.erb
  86. +12 −0 nginx/attributes/nginx_locations.rb
  87. +12 −0 nginx/attributes/nginx_settings.rb
  88. +37 −0 nginx/definitions/nginx_site.rb
  89. +56 −0 nginx/recipes/default.rb
  90. +11 −0 nginx/templates/default/default-site.erb
  91. +37 −0 nginx/templates/default/nginx.conf.erb
  92. +29 −0 nginx/templates/default/nxdissite.erb
  93. +38 −0 nginx/templates/default/nxensite.erb
  94. +45 −0 openssh/recipes/default.rb
  95. +2 −0 openssh/templates/default/port_ssh.erb
  96. +1 −0 quick_start/attributes/quick_start.rb
  97. +24 −0 quick_start/recipes/default.rb
  98. +1 −0 quick_start/templates/default/deep_thought.txt.erb
  99. 0 redmine/attributes/redmine_settings.rb
  100. +27 −0 redmine/recipes/default.rb
  101. +47 −0 redmine/templates/default/database.yml.erb
  102. +2 −0 redmine/templates/default/port_redmine.erb
  103. +142 −0 redmine/templates/default/settings.yml.erb
  104. +2 −0 redmine/templates/default/sv-redmine-log-run.erb
  105. +3 −0 redmine/templates/default/sv-redmine-run.erb
  106. +20 −0 rsync/recipes/default.rb
  107. +50 −0 ruby/recipes/default.rb
  108. +27 −0 runit/attributes/sv_bin.rb
  109. +72 −0 runit/definitions/runit_service.rb
  110. +6 −0 runit/files/Ubuntu-6.10/runsvdir
  111. +7 −0 runit/files/Ubuntu-7.04/runsvdir
  112. +7 −0 runit/files/Ubuntu-7.10/runsvdir
  113. +45 −0 runit/recipes/default.rb
  114. +22 −0 screen/recipes/default.rb
  115. +39 −0 subversion/recipes/default.rb
  116. +30 −0 sudo/attributes/sudoers.rb
  117. +33 −0 sudo/recipes/default.rb
  118. +22 −0 sudo/templates/default/sudoers.erb
  119. +25 −0 teamspeak/recipes/default.rb
  120. +4 −0 teamspeak/templates/default/port_teamspeak.erb
  121. +26 −0 ubuntu/recipes/default.rb
  122. +15 −0 ubuntu/templates/default/sources.list.erb
  123. +29 −0 zsh/recipes/default.rb
201 LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+Copyright [yyyy] [name of copyright owner]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
12 NOTICE
@@ -0,0 +1,12 @@
+=========================
+Opscode Cookbooks Notices
+=========================
+
+Developed at Opscode (http://www.opscode.com).
+
+Contributors and Copyright holders:
+
+ * Copyright 2008-2009, Opscode <legal@opscode.com>
+ * Copyright 2008-2009, Adam Jacob <adam@opscode.com>
+ * Copyright 2008-2009, Joshua Timberman <joshua@opscode.com>
+
72 apache2/attributes/apache.rb
@@ -0,0 +1,72 @@
+#
+# Cookbook Name:: apache2
+# Attributes:: apache
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache Mash.new unless attribute?("apache")
+
+# Where the various parts of apache are
+case platform
+when "redhat","centos","fedora","suse"
+ apache[:dir] = "/etc/httpd"
+ apache[:log_dir] = "/var/log/httpd"
+ apache[:user] = "apache"
+ apache[:binary] = "/usr/sbin/httpd"
+ apache[:icondir] = "/var/www/icons"
+when "debian","ubuntu"
+ apache[:dir] = "/etc/apache2"
+ apache[:log_dir] = "/var/log/apache2"
+ apache[:user] = "www-data"
+ apache[:binary] = "/usr/sbin/apache2"
+ apache[:icondir] = "/usr/share/apache2/icons"
+else
+ apache[:dir] = "/etc/apache2"
+ apache[:log_dir] = "/var/log/apache2"
+ apache[:user] = "www-data"
+ apache[:binary] = "/usr/sbin/apache2"
+ apache[:icondir] = "/usr/share/apache2/icons"
+end
+
+###
+# These settings need the unless, since we want them to be tunable,
+# and we don't want to override the tunings.
+###
+
+# General settings
+apache[:listen_ports] = [ "80" ] unless apache.has_key?(:listen_ports)
+apache[:contact] = "ops@example.com" unless apache.has_key?(:contact)
+apache[:timeout] = 300 unless apache.has_key?(:timeout)
+apache[:keepalive] = "On" unless apache.has_key?(:keepalive)
+apache[:keepaliverequests] = 100 unless apache.has_key?(:keepaliverequests)
+apache[:keepalivetimeout] = 5 unless apache.has_key?(:keepalivetimeout)
+
+# Prefork Attributes
+apache[:prefork] = Mash.new unless apache.has_key?(:prefork)
+apache[:prefork][:startservers] = 16 unless apache[:prefork].has_key?(:prefork_startservers)
+apache[:prefork][:minspareservers] = 16 unless apache[:prefork].has_key?(:prefork_minspareservers)
+apache[:prefork][:maxspareservers] = 32 unless apache[:prefork].has_key?(:prefork_maxspareservers)
+apache[:prefork][:maxclients] = 400 unless apache[:prefork].has_key?(:prefork_maxclients)
+apache[:prefork][:maxrequestsperchild] = 10000 unless apache[:prefork].has_key?(:prefork_maxrequestsperchild)
+
+# Worker Attributes
+apache[:worker] = Mash.new unless apache.has_key?(:worker)
+apache[:worker][:startservers] = 4 unless apache[:worker].has_key?(:startservers)
+apache[:worker][:maxclients] = 1024 unless apache[:worker].has_key?(:maxclients)
+apache[:worker][:minsparethreads] = 64 unless apache[:worker].has_key?(:minsparethreads)
+apache[:worker][:maxsparethreads] = 192 unless apache[:worker].has_key?(:maxsparethreads)
+apache[:worker][:threadsperchild] = 64 unless apache[:worker].has_key?(:threadsperchild)
+apache[:worker][:maxrequestsperchild] = 0 unless apache[:worker].has_key?(:maxrequestsperchild)
36 apache2/definitions/apache_module.rb
@@ -0,0 +1,36 @@
+#
+# Cookbook Name:: apache2
+# Definition:: apache_module
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+define :apache_module, :enable => true do
+ include_recipe "apache2"
+
+ if params[:enable]
+ execute "a2enmod #{params[:name]}" do
+ command "/usr/sbin/a2enmod #{params[:name]}"
+ notifies :restart, resources(:service => "apache2")
+ not_if do File.symlink?("#{node[:apache][:dir]}/mods-enabled/#{params[:name]}.load") end
+ end
+ else
+ execute "a2dismod #{params[:name]}" do
+ command "/usr/sbin/a2dismod #{params[:name]}"
+ notifies :restart, resources(:service => "apache2")
+ only_if do File.symlink?("#{node[:apache][:dir]}/mods-enabled/#{params[:name]}.load") end
+ end
+ end
+end
36 apache2/definitions/apache_site.rb
@@ -0,0 +1,36 @@
+#
+# Cookbook Name:: apache2
+# Definition:: apache_site
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+define :apache_site, :enable => true do
+ include_recipe "apache2"
+
+ if params[:enable]
+ execute "a2ensite #{params[:name]}" do
+ command "/usr/sbin/a2ensite #{params[:name]}"
+ notifies :restart, resources(:service => "apache2")
+ not_if do File.symlink?("#{node[:apache][:dir]}/sites-enabled/#{params[:name]}") end
+ end
+ else
+ execute "a2dissite #{params[:name]}" do
+ command "/usr/sbin/a2dissite #{params[:name]}"
+ notifies :restart, resources(:service => "apache2")
+ only_if do File.symlink?("#{node[:apache][:dir]}/sites-enabled/#{params[:name]}") end
+ end
+ end
+end
41 apache2/files/default/apache2_module_conf_generate.pl
@@ -0,0 +1,41 @@
+#!/usr/bin/perl
+
+=begin
+
+Generates Ubuntu style module.load files.
+
+./apache2_module_conf_genereate.pl /usr/lib64/httpd/modules /etc/httpd/mods-available
+
+ARGV[0] is the apache modules directory, ARGV[1] is where you want 'em.
+
+=cut
+
+use File::Find;
+
+use strict;
+use warnings;
+
+die "Must have '/path/to/modules' and '/path/to/modules.load'"
+ unless $ARGV[0] && $ARGV[1];
+
+find(
+ {
+ wanted => sub {
+ return 1 if $File::Find::name !~ /\.so$/;
+ my $modfile = $_;
+ $modfile =~ /mod_(.+)\.so$/;
+ my $modname = $1;
+ my $filename = "$ARGV[1]/$modname.load";
+ unless ( -f $filename ) {
+ open( FILE, ">", $filename ) or die "Cannot open $filename";
+ print FILE "LoadModule " . $modname . "_module $File::Find::name\n";
+ close(FILE);
+ }
+ },
+ follow => 1,
+ },
+ $ARGV[0]
+);
+
+exit 0;
+
141 apache2/recipes/default.rb
@@ -0,0 +1,141 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: default
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include_recipe "iptables"
+
+package "apache2" do
+ case node[:platform]
+ when "CentOS","RedHat","Fedora","SuSE"
+ name "httpd"
+ when "Debian","Ubuntu"
+ name "apache2"
+ end
+ action :install
+end
+
+service "apache2" do
+ case node[:platform]
+ when "CentOS","RedHat","Fedora","SuSE"
+ name "httpd"
+ when "Debian","Ubuntu"
+ name "apache2"
+ end
+ supports :restart => true
+ action :enable
+end
+
+if platform?("CentOS", "RedHat", "Fedora", "SuSE")
+ directory node[:apache][:log_dir] do
+ mode 0755
+ action :create
+ end
+
+ remote_file "/usr/local/bin/apache2_module_conf_generate.pl" do
+ source "apache2_module_conf_generate.pl"
+ mode 0755
+ owner "root"
+ group "root"
+ end
+
+ %w{sites-available sites-enabled mods-available mods-enabled}.each do |dir|
+ directory "#{node[:apache][:dir]}/#{dir}" do
+ mode 0755
+ owner "root"
+ group "root"
+ action :create
+ end
+ end
+
+ execute "generate-module-list" do
+ command "/usr/local/bin/apache2_module_conf_generate.pl /usr/#{node[:architecture]}/httpd/modules /etc/httpd/mods-available"
+ action :run
+ end
+
+ %w{a2ensite a2dissite s2enmod s2dismod}.each do |modscript|
+ template "/usr/sbin/#{modscript}" do
+ source "#{modscript}.erb"
+ mode 0755
+ owner "root"
+ group "root"
+ end
+ end
+end
+
+directory "#{node[:apache][:dir]}/ssl" do
+ action :create
+ mode 0755
+ owner "root"
+ group "root"
+end
+
+template "apache2.conf" do
+ case node[:platform]
+ when "CentOS","RedHat","Fedora"
+ path "#{node[:apache][:dir]}/conf/httpd.conf"
+ when "Debian","Ubuntu"
+ path "#{node[:apache][:dir]}/apache2.conf"
+ end
+ source "apache2.conf.erb"
+ owner "root"
+ group "root"
+ mode 0644
+end
+
+template "#{node[:apache][:dir]}/ports.conf" do
+ source "ports.conf.erb"
+ group "root"
+ owner "root"
+ variables :apache_listen_ports => node[:apache][:listen_ports]
+ mode 0644
+end
+
+node[:apache][:listen_ports].each do |port|
+ iptables_rule "port_#{port}" do
+ source "port_apache.erb"
+ variables :port => port
+ end
+end
+
+template "#{node[:apache][:dir]}/sites-available/default" do
+ source "default-site.erb"
+ owner "root"
+ group "root"
+ mode 0644
+ notifies :restart, resources(:service => "apache2")
+end
+
+include_recipe "apache2::mod_status"
+include_recipe "apache2::mod_alias"
+include_recipe "apache2::mod_auth_basic"
+include_recipe "apache2::mod_authn_file"
+include_recipe "apache2::mod_authz_default"
+include_recipe "apache2::mod_authz_groupfile"
+include_recipe "apache2::mod_authz_host"
+include_recipe "apache2::mod_authz_user"
+include_recipe "apache2::mod_autoindex"
+include_recipe "apache2::mod_dir"
+include_recipe "apache2::mod_env"
+include_recipe "apache2::mod_mime"
+include_recipe "apache2::mod_negotiation"
+include_recipe "apache2::mod_setenvif"
+include_recipe "apache2::mod_log_config" if platform?("CentOS", "RedHat", "SuSE")
+
+service "apache2" do
+ action :start
+end
20 apache2/recipes/mod_alias.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: alias
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "alias"
20 apache2/recipes/mod_auth_basic.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: auth_basic
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "auth_basic"
20 apache2/recipes/mod_auth_digest.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: auth_digest
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "auth_digest"
20 apache2/recipes/mod_authn_file.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: authn_file
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "authn_file"
20 apache2/recipes/mod_authnz_ldap.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: authnz_ldap
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "authnz_ldap"
20 apache2/recipes/mod_authz_default.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: authz_default
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "authz_default"
20 apache2/recipes/mod_authz_groupfile.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: authz_groupfile
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "authz_groupfile"
20 apache2/recipes/mod_authz_host.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: authz_host
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "authz_host"
20 apache2/recipes/mod_authz_user.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: authz_user
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "authz_user"
20 apache2/recipes/mod_autoindex.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: autoindex
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "autoindex"
20 apache2/recipes/mod_cgi.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: cgi
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "cgi"
20 apache2/recipes/mod_dav.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: dav
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "dav"
20 apache2/recipes/mod_dav_svn.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: dav_svn
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "dav_svn"
20 apache2/recipes/mod_deflate.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: deflate
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "deflate"
20 apache2/recipes/mod_dir.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: dir
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "dir"
20 apache2/recipes/mod_env.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: env
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "env"
20 apache2/recipes/mod_expires.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: expires
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "expires"
35 apache2/recipes/mod_fcgid.rb
@@ -0,0 +1,35 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: fcgid
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+if platform?("Debian", "Ubuntu")
+ package "libapache2-mod-fcgid"
+elsif platform?("CentOS", "RedHat", "SuSE")
+ apache_lib_path = node[:architecture] == "i386" ? "/usr/lib/httpd" : "/usr/lib64/httpd"
+ package "httpd-devel"
+ bash "install-fcgid" do
+ code <<-EOH
+(cd /tmp; wget http://superb-east.dl.sourceforge.net/sourceforge/mod-fcgid/mod_fcgid.2.2.tgz)
+(cd /tmp; tar zxvf mod_fcgid.2.2.tgz)
+(cd /tmp; perl -pi -e 's!/usr/local/apache2!#{apache_lib_path}!g' ./mod_fcgid.2.2/Makefile)
+(cd /tmp/mod_fcgid.2.2; make install)
+EOH
+ end
+end
+
+apache_module "fcgid"
20 apache2/recipes/mod_headers.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: headers
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "headers"
20 apache2/recipes/mod_ldap.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: ldap
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "ldap"
20 apache2/recipes/mod_log_config.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: log_config
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "log_config"
20 apache2/recipes/mod_mime.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: mime
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "mime"
20 apache2/recipes/mod_negotiation.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: negotiation
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "negotiation"
20 apache2/recipes/mod_php5.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: php5
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "php5"
20 apache2/recipes/mod_proxy.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: proxy
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "proxy"
20 apache2/recipes/mod_proxy_http.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: proxy_http
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "proxy_http"
22 apache2/recipes/mod_python.rb
@@ -0,0 +1,22 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: python
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+package "libapache2-mod-python"
+
+apache_module "python"
20 apache2/recipes/mod_rewrite.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: rewrite
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "rewrite"
20 apache2/recipes/mod_setenvif.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: setenvif
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "setenvif"
20 apache2/recipes/mod_ssl.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: ssl
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "ssl"
20 apache2/recipes/mod_status.rb
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: status
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apache_module "status"
22 apache2/templates/default/a2dismod.erb
@@ -0,0 +1,22 @@
+#!/bin/sh -e
+
+SYSCONFDIR='<%= @node[:apache][:dir] %>'
+
+if [ -z $1 ]; then
+ echo "Which module would you like to disable?"
+ echo -n "Your choices are: "
+ ls $SYSCONFDIR/mods-enabled/*.load | \
+ sed -e "s,$SYSCONFDIR/mods-enabled/,,g" | sed -e 's/\.load$//g;' | xargs echo
+ echo -n "Module name? "
+ read MODNAME
+else
+ MODNAME=$1
+fi
+
+if ! [ -e $SYSCONFDIR/mods-enabled/$MODNAME.load ]; then
+ echo "This module is already disabled, or does not exist!"
+ exit 1
+fi
+
+rm -f $SYSCONFDIR/mods-enabled/$MODNAME.*
+echo "Module $MODNAME disabled; reload apache to fully disable."
29 apache2/templates/default/a2dissite.erb
@@ -0,0 +1,29 @@
+#!/bin/sh -e
+
+SYSCONFDIR='<%= @node[:apache][:dir] %>'
+
+if [ -z $1 ]; then
+ echo "Which site would you like to disable?"
+ echo -n "Your choices are: "
+ ls $@node[:apache][:dir]/sites-enabled/* | \
+ sed -e "s,$SYSCONFDIR/sites-enabled/,,g" | xargs echo
+ echo -n "Site name? "
+ read SITENAME
+else
+ SITENAME=$1
+fi
+
+if [ $SITENAME = "default" ]; then
+ PRIORITY="000"
+fi
+
+if ! [ -e $SYSCONFDIR/sites-enabled/$SITENAME -o \
+ -e $SYSCONFDIR/sites-enabled/"$PRIORITY"-"$SITENAME" ]; then
+ echo "This site is already disabled, or does not exist!"
+ exit 1
+fi
+
+if ! rm $SYSCONFDIR/sites-enabled/$SITENAME 2>/dev/null; then
+ rm -f $SYSCONFDIR/sites-enabled/"$PRIORITY"-"$SITENAME"
+fi
+echo "Site $SITENAME disabled; reload apache to disable."
37 apache2/templates/default/a2enmod.erb
@@ -0,0 +1,37 @@
+#!/bin/sh -e
+
+SYSCONFDIR='<%= @node[:apache][:dir] %>'
+
+if [ -z $1 ]; then
+ echo "Which module would you like to enable?"
+ echo -n "Your choices are: "
+ ls $SYSCONFDIR/mods-available/*.load | \
+ sed -e "s,$SYSCONFDIR/mods-available/,,g" | sed -e 's/\.load$//g;' | xargs echo
+ echo -n "Module name? "
+ read MODNAME
+else
+ MODNAME=$1
+fi
+
+#figure out if we're on a prefork or threaded mpm
+if [ -x /usr/sbin/apache2 ]; then
+ PREFORK=`/usr/sbin/apache2 -l | grep prefork || true`
+fi
+
+if [ -e $SYSCONFDIR/mods-enabled/$MODNAME.load ]; then
+ echo "This module is already enabled!"
+ exit 0
+fi
+
+if ! [ -e $SYSCONFDIR/mods-available/$MODNAME.load ]; then
+ echo "This module does not exist!"
+ exit 1
+fi
+
+for i in conf load; do
+ if [ -e $SYSCONFDIR/mods-available/$MODNAME.$i -a ! -e $SYSCONFDIR/mods-enabled/$MODNAME.$i ]; then
+ ln -sf $SYSCONFDIR/mods-available/$MODNAME.$i $SYSCONFDIR/mods-enabled/$MODNAME.$i;
+ fi
+done
+
+echo "Module $MODNAME installed; reload apache to enable."
38 apache2/templates/default/a2ensite.erb
@@ -0,0 +1,38 @@
+#!/bin/sh -e
+
+SYSCONFDIR='<%= @node[:apache][:dir] %>'
+
+if [ -z $1 ]; then
+ echo "Which site would you like to enable?"
+ echo -n "Your choices are: "
+ ls $SYSCONFDIR/sites-available/* | \
+ sed -e "s,$SYSCONFDIR/sites-available/,,g" | xargs echo
+ echo -n "Site name? "
+ read SITENAME
+else
+ SITENAME=$1
+fi
+
+if [ $SITENAME = "default" ]; then
+ PRIORITY="000"
+fi
+
+if [ -e $SYSCONFDIR/sites-enabled/$SITENAME -o \
+ -e $SYSCONFDIR/sites-enabled/"$PRIORITY"-"$SITENAME" ]; then
+ echo "This site is already enabled!"
+ exit 0
+fi
+
+if ! [ -e $SYSCONFDIR/sites-available/$SITENAME ]; then
+ echo "This site does not exist!"
+ exit 1
+fi
+
+if [ $SITENAME = "default" ]; then
+ ln -sf $SYSCONFDIR/sites-available/$SITENAME \
+ $SYSCONFDIR/sites-enabled/"$PRIORITY"-"$SITENAME"
+else
+ ln -sf $SYSCONFDIR/sites-available/$SITENAME $SYSCONFDIR/sites-enabled/$SITENAME
+fi
+
+echo "Site $SITENAME installed; reload apache to enable."
630 apache2/templates/default/apache2.conf.erb
@@ -0,0 +1,630 @@
+#
+# Generated by Puppet
+#
+# Based on the Ubuntu apache2.conf
+
+ServerRoot "<%= @node[:apache][:dir] %>"
+
+#
+# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
+#
+<% if @node[:platform] == "debian" || @node[:platform] == "ubuntu" -%>
+LockFile /var/lock/apache2/accept.lock
+<% else %>
+LockFile logs/accept.lock
+<% end -%>
+
+#
+# PidFile: The file in which the server should record its process
+# identification number when it starts.
+#
+<% if @node[:platform] == "debian" || @node[:platform] == "ubuntu" -%>
+PidFile /var/run/apache2.pid
+<% else -%>
+PidFile logs/httpd.pid
+<% end -%>
+
+#
+# Timeout: The number of seconds before receives and sends time out.
+#
+Timeout <%= @node[:apache][:timeout] %>
+
+#
+# KeepAlive: Whether or not to allow persistent connections (more than
+# one request per connection). Set to "Off" to deactivate.
+#
+KeepAlive <%= @node[:apache][:keepalive] %>
+
+#
+# MaxKeepAliveRequests: The maximum number of requests to allow
+# during a persistent connection. Set to 0 to allow an unlimited amount.
+# We recommend you leave this number high, for maximum performance.
+#
+MaxKeepAliveRequests <%= @node[:apache][:keepaliverequests] %>
+
+#
+# KeepAliveTimeout: Number of seconds to wait for the next request from the
+# same client on the same connection.
+#
+KeepAliveTimeout <%= @node[:apache][:keepalivetimeout] %>
+
+##
+## Server-Pool Size Regulation (MPM specific)
+##
+
+# prefork MPM
+# StartServers: number of server processes to start
+# MinSpareServers: minimum number of server processes which are kept spare
+# MaxSpareServers: maximum number of server processes which are kept spare
+# MaxClients: maximum number of server processes allowed to start
+# MaxRequestsPerChild: maximum number of requests a server process serves
+<IfModule mpm_prefork_module>
+ StartServers <%= @node[:apache][:prefork][:startservers] %>
+ MinSpareServers <%= @node[:apache][:prefork][:minspareservers] %>
+ MaxSpareServers <%= @node[:apache][:prefork][:maxspareservers] %>
+ MaxClients <%= @node[:apache][:prefork][:maxclients] %>
+ MaxRequestsPerChild <%= @node[:apache][:prefork][:maxrequestsperchild] %>
+</IfModule>
+
+# worker MPM
+# StartServers: initial number of server processes to start
+# MaxClients: maximum number of simultaneous client connections
+# MinSpareThreads: minimum number of worker threads which are kept spare
+# MaxSpareThreads: maximum number of worker threads which are kept spare
+# ThreadsPerChild: constant number of worker threads in each server process
+# MaxRequestsPerChild: maximum number of requests a server process serves
+<IfModule mpm_worker_module>
+ StartServers <%= @node[:apache][:worker][:startservers] %>
+ MaxClients <%= @node[:apache][:worker][:maxclients] %>
+ MinSpareThreads <%= @node[:apache][:worker][:minsparethreads] %>
+ MaxSpareThreads <%= @node[:apache][:worker][:maxsparethreads] %>
+ ThreadsPerChild <%= @node[:apache][:worker][:threadsperchild] %>
+ MaxRequestsPerChild <%= @node[:apache][:worker][:maxrequestsperchild] %>
+</IfModule>
+
+User <%= @node[:apache][:user] %>
+Group <%= @node[:apache][:user] %>
+
+#
+# AccessFileName: The name of the file to look for in each directory
+# for additional configuration directives. See also the AllowOverride
+# directive.
+#
+
+AccessFileName .htaccess
+
+#
+# The following lines prevent .htaccess and .htpasswd files from being
+# viewed by Web clients.
+#
+<Files ~ "^\.ht">
+ Order allow,deny
+ Deny from all
+</Files>
+
+TypesConfig /etc/mime.types
+
+#
+# DefaultType is the default MIME type the server will use for a document
+# if it cannot otherwise determine one, such as from filename extensions.
+# If your server contains mostly text or HTML documents, "text/plain" is
+# a good value. If most of your content is binary, such as applications
+# or images, you may want to use "application/octet-stream" instead to
+# keep browsers from trying to display binary files as though they are
+# text.
+#
+DefaultType text/plain
+
+
+#
+# HostnameLookups: Log the names of clients or just their IP addresses
+# e.g., www.apache.org (on) or 204.62.129.132 (off).
+# The default is off because it'd be overall better for the net if people
+# had to knowingly turn this feature on, since enabling it means that
+# each client request will result in AT LEAST one lookup request to the
+# nameserver.
+#
+HostnameLookups Off
+
+# ErrorLog: The location of the error log file.
+# If you do not specify an ErrorLog directive within a <VirtualHost>
+# container, error messages relating to that virtual host will be
+# logged here. If you *do* define an error logfile for a <VirtualHost>
+# container, that host's errors will be logged there and not here.
+#
+ErrorLog <%= @node[:apache][:log_dir] %>/error.log
+
+#
+# LogLevel: Control the number of messages logged to the error_log.
+# Possible values include: debug, info, notice, warn, error, crit,
+# alert, emerg.
+#
+LogLevel warn
+
+# Include module configuration:
+Include <%= @node[:apache][:dir] %>/mods-enabled/*.load
+Include <%= @node[:apache][:dir] %>/mods-enabled/*.conf
+
+# Include ports listing
+Include <%= @node[:apache][:dir] %>/ports.conf
+
+# Include generic snippets of statements
+Include <%= @node[:apache][:dir] %>/conf.d/*.conf
+
+#
+# The following directives define some format nicknames for use with
+# a CustomLog directive (see below).
+#
+LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
+LogFormat "%h %l %u %t \"%r\" %>s %b" common
+LogFormat "%{Referer}i -> %U" referer
+LogFormat "%{User-agent}i" agent
+
+#
+# ServerTokens
+# This directive configures what you return as the Server HTTP response
+# Header. The default is 'Full' which sends information about the OS-Type
+# and compiled in modules.
+# Set to one of: Full | OS | Minor | Minimal | Major | Prod
+# where Full conveys the most information, and Prod the least.
+#
+ServerTokens Full
+
+#
+# Optionally add a line containing the server version and virtual host
+# name to server-generated pages (internal error documents, FTP directory
+# listings, mod_status and mod_info output etc., but not CGI generated
+# documents or custom error documents).
+# Set to "EMail" to also include a mailto: link to the ServerAdmin.
+# Set to one of: On | Off | EMail
+#
+ServerSignature On
+
+<IfModule alias_module>
+ #
+ # Aliases: Add here as many aliases as you need (with no limit). The format is
+ # Alias fakename realname
+ #
+ # Note that if you include a trailing / on fakename then the server will
+ # require it to be present in the URL. So "/icons" isn't aliased in this
+ # example, only "/icons/". If the fakename is slash-terminated, then the
+ # realname must also be slash terminated, and if the fakename omits the
+ # trailing slash, the realname must also omit it.
+ #
+ # We include the /icons/ alias for FancyIndexed directory listings. If
+ # you do not use FancyIndexing, you may comment this out.
+ Alias /icons/ "<%= @node[:apache][:icondir] %>"
+
+ <Directory "<%= @node[:apache][:icondir] %>">
+ Options Indexes MultiViews
+ AllowOverride None
+ Order allow,deny
+ Allow from all
+ </Directory>
+
+</IfModule>
+
+#
+# Directives controlling the display of server-generated directory listings.
+#
+<IfModule mod_autoindex.c>
+
+ #
+ # IndexOptions: Controls the appearance of server-generated directory
+ # listings.
+ #
+ IndexOptions FancyIndexing VersionSort HTMLTable NameWidth=*
+
+ #
+ # AddIcon* directives tell the server which icon to show for different
+ # files or filename extensions. These are only displayed for
+ # FancyIndexed directories.
+ #
+ AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
+
+ AddIconByType (TXT,/icons/text.gif) text/*
+ AddIconByType (IMG,/icons/image2.gif) image/*
+ AddIconByType (SND,/icons/sound2.gif) audio/*
+ AddIconByType (VID,/icons/movie.gif) video/*
+
+ AddIcon /icons/binary.gif .bin .exe
+ AddIcon /icons/binhex.gif .hqx
+ AddIcon /icons/tar.gif .tar
+ AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
+ AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
+ AddIcon /icons/a.gif .ps .ai .eps
+ AddIcon /icons/layout.gif .html .shtml .htm .pdf
+ AddIcon /icons/text.gif .txt
+ AddIcon /icons/c.gif .c
+ AddIcon /icons/p.gif .pl .py
+ AddIcon /icons/f.gif .for
+ AddIcon /icons/dvi.gif .dvi
+ AddIcon /icons/uuencoded.gif .uu
+ AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
+ AddIcon /icons/tex.gif .tex
+ AddIcon /icons/bomb.gif core
+
+ AddIcon /icons/back.gif ..
+ AddIcon /icons/hand.right.gif README
+ AddIcon /icons/folder.gif ^^DIRECTORY^^
+ AddIcon /icons/blank.gif ^^BLANKICON^^
+
+ #
+ # DefaultIcon is which icon to show for files which do not have an icon
+ # explicitly set.
+ #
+ DefaultIcon /icons/unknown.gif
+
+ #
+ # AddDescription allows you to place a short description after a file in
+ # server-generated indexes. These are only displayed for FancyIndexed
+ # directories.
+ # Format: AddDescription "description" filename
+ #
+ #AddDescription "GZIP compressed document" .gz
+ #AddDescription "tar archive" .tar
+ #AddDescription "GZIP compressed tar archive" .tgz
+
+ #
+ # ReadmeName is the name of the README file the server will look for by
+ # default, and append to directory listings.
+ #
+ # HeaderName is the name of a file which should be prepended to
+ # directory indexes.
+ ReadmeName README.html
+ HeaderName HEADER.html
+
+ #
+ # IndexIgnore is a set of filenames which directory indexing should ignore
+ # and not include in the listing. Shell-style wildcarding is permitted.
+ #
+ IndexIgnore .??* *~ *# RCS CVS *,v *,t
+</IfModule>
+
+<IfModule mod_mime.c>
+
+ #
+ # AddType allows you to add to or override the MIME configuration
+ # file mime.types for specific file types.
+ #
+ #AddType application/x-gzip .tgz
+ #
+ # AddEncoding allows you to have certain browsers uncompress
+ # information on the fly. Note: Not all browsers support this.
+ # Despite the name similarity, the following Add* directives have
+ # nothing to do with the FancyIndexing customization directives above.
+ #
+ #AddEncoding x-compress .Z
+ #AddEncoding x-gzip .gz .tgz
+ #
+ # If the AddEncoding directives above are commented-out, then you
+ # probably should define those extensions to indicate media types:
+ #
+ AddType application/x-compress .Z
+ AddType application/x-gzip .gz .tgz
+
+ #
+ # DefaultLanguage and AddLanguage allows you to specify the language of
+ # a document. You can then use content negotiation to give a browser a
+ # file in a language the user can understand.
+ #
+ # Specify a default language. This means that all data
+ # going out without a specific language tag (see below) will
+ # be marked with this one. You probably do NOT want to set
+ # this unless you are sure it is correct for all cases.
+ #
+ # * It is generally better to not mark a page as
+ # * being a certain language than marking it with the wrong
+ # * language!
+ #
+ # DefaultLanguage nl
+ #
+ # Note 1: The suffix does not have to be the same as the language
+ # keyword --- those with documents in Polish (whose net-standard
+ # language code is pl) may wish to use "AddLanguage pl .po" to
+ # avoid the ambiguity with the common suffix for perl scripts.
+ #
+ # Note 2: The example entries below illustrate that in some cases
+ # the two character 'Language' abbreviation is not identical to
+ # the two character 'Country' code for its country,
+ # E.g. 'Danmark/dk' versus 'Danish/da'.
+ #
+ # Note 3: In the case of 'ltz' we violate the RFC by using a three char
+ # specifier. There is 'work in progress' to fix this and get
+ # the reference data for rfc1766 cleaned up.
+ #
+ # Catalan (ca) - Croatian (hr) - Czech (cs) - Danish (da) - Dutch (nl)
+ # English (en) - Esperanto (eo) - Estonian (et) - French (fr) - German (de)
+ # Greek-Modern (el) - Hebrew (he) - Italian (it) - Japanese (ja)
+ # Korean (ko) - Luxembourgeois* (ltz) - Norwegian Nynorsk (nn)
+ # Norwegian (no) - Polish (pl) - Portugese (pt)
+ # Brazilian Portuguese (pt-BR) - Russian (ru) - Swedish (sv)
+ # Simplified Chinese (zh-CN) - Spanish (es) - Traditional Chinese (zh-TW)
+ #
+ AddLanguage ca .ca
+ AddLanguage cs .cz .cs
+ AddLanguage da .dk
+ AddLanguage de .de
+ AddLanguage el .el
+ AddLanguage en .en
+ AddLanguage eo .eo
+ AddLanguage es .es
+ AddLanguage et .et
+ AddLanguage fr .fr
+ AddLanguage he .he
+ AddLanguage hr .hr
+ AddLanguage it .it
+ AddLanguage ja .ja
+ AddLanguage ko .ko
+ AddLanguage ltz .ltz
+ AddLanguage nl .nl
+ AddLanguage nn .nn
+ AddLanguage no .no
+ AddLanguage pl .po
+ AddLanguage pt .pt
+ AddLanguage pt-BR .pt-br
+ AddLanguage ru .ru
+ AddLanguage sv .sv
+ AddLanguage zh-CN .zh-cn
+ AddLanguage zh-TW .zh-tw
+</IfModule>
+
+<IfModule mod_negotiation.c>
+ #
+ # LanguagePriority allows you to give precedence to some languages
+ # in case of a tie during content negotiation.
+ #
+ # Just list the languages in decreasing order of preference. We have
+ # more or less alphabetized them here. You probably want to change this.
+ #
+ LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW
+
+ #
+ # ForceLanguagePriority allows you to serve a result page rather than
+ # MULTIPLE CHOICES (Prefer) [in case of a tie] or NOT ACCEPTABLE (Fallback)
+ # [in case no accepted languages matched the available variants]
+ #
+ ForceLanguagePriority Prefer Fallback
+
+</IfModule>
+
+<IfModule mod_mime.c>
+ #
+ # Specify a default charset for all pages sent out. This is
+ # always a good idea and opens the door for future internationalisation
+ # of your web site, should you ever want it. Specifying it as
+ # a default does little harm; as the standard dictates that a page
+ # is in iso-8859-1 (latin1) unless specified otherwise i.e. you
+ # are merely stating the obvious. There are also some security
+ # reasons in browsers, related to javascript and URL parsing
+ # which encourage you to always set a default char set.
+ #
+ #AddDefaultCharset ISO-8859-1
+
+ #
+ # Commonly used filename extensions to character sets. You probably
+ # want to avoid clashes with the language extensions, unless you
+ # are good at carefully testing your setup after each change.
+ # See http://www.iana.org/assignments/character-sets for the
+ # official list of charset names and their respective RFCs.
+ #
+ AddCharset us-ascii .ascii .us-ascii
+ AddCharset ISO-8859-1 .iso8859-1 .latin1
+ AddCharset ISO-8859-2 .iso8859-2 .latin2 .cen
+ AddCharset ISO-8859-3 .iso8859-3 .latin3
+ AddCharset ISO-8859-4 .iso8859-4 .latin4
+ AddCharset ISO-8859-5 .iso8859-5 .cyr .iso-ru
+ AddCharset ISO-8859-6 .iso8859-6 .arb .arabic
+ AddCharset ISO-8859-7 .iso8859-7 .grk .greek
+ AddCharset ISO-8859-8 .iso8859-8 .heb .hebrew
+ AddCharset ISO-8859-9 .iso8859-9 .latin5 .trk
+ AddCharset ISO-8859-10 .iso8859-10 .latin6
+ AddCharset ISO-8859-13 .iso8859-13
+ AddCharset ISO-8859-14 .iso8859-14 .latin8
+ AddCharset ISO-8859-15 .iso8859-15 .latin9
+ AddCharset ISO-8859-16 .iso8859-16 .latin10
+ AddCharset ISO-2022-JP .iso2022-jp .jis
+ AddCharset ISO-2022-KR .iso2022-kr .kis
+ AddCharset ISO-2022-CN .iso2022-cn .cis
+ AddCharset Big5 .Big5 .big5 .b5
+ AddCharset cn-Big5 .cn-big5
+ # For russian, more than one charset is used (depends on client, mostly):
+ AddCharset WINDOWS-1251 .cp-1251 .win-1251
+ AddCharset CP866 .cp866
+ AddCharset KOI8 .koi8
+ AddCharset KOI8-E .koi8-e
+ AddCharset KOI8-r .koi8-r .koi8-ru
+ AddCharset KOI8-U .koi8-u
+ AddCharset KOI8-ru .koi8-uk .ua
+ AddCharset ISO-10646-UCS-2 .ucs2
+ AddCharset ISO-10646-UCS-4 .ucs4
+ AddCharset UTF-7 .utf7
+ AddCharset UTF-8 .utf8
+ AddCharset UTF-16 .utf16
+ AddCharset UTF-16BE .utf16be
+ AddCharset UTF-16LE .utf16le
+ AddCharset UTF-32 .utf32
+ AddCharset UTF-32BE .utf32be
+ AddCharset UTF-32LE .utf32le
+ AddCharset euc-cn .euc-cn
+ AddCharset euc-gb .euc-gb
+ AddCharset euc-jp .euc-jp
+ AddCharset euc-kr .euc-kr
+ #Not sure how euc-tw got in - IANA doesn't list it???
+ AddCharset EUC-TW .euc-tw
+ AddCharset gb2312 .gb2312 .gb
+ AddCharset iso-10646-ucs-2 .ucs-2 .iso-10646-ucs-2
+ AddCharset iso-10646-ucs-4 .ucs-4 .iso-10646-ucs-4
+ AddCharset shift_jis .shift_jis .sjis
+
+ #
+ # AddHandler allows you to map certain file extensions to "handlers":
+ # actions unrelated to filetype. These can be either built into the server
+ # or added with the Action directive (see below)
+ #
+ # To use CGI scripts outside of ScriptAliased directories:
+ # (You will also need to add "ExecCGI" to the "Options" directive.)
+ #
+ #AddHandler cgi-script .cgi
+
+ #
+ # For files that include their own HTTP headers:
+ #
+ #AddHandler send-as-is asis
+
+ #
+ # For server-parsed imagemap files:
+ #
+ #AddHandler imap-file map
+
+ #
+ # For type maps (negotiated resources):
+ # (This is enabled by default to allow the Apache "It Worked" page
+ # to be distributed in multiple languages.)
+ #
+ AddHandler type-map var
+
+ #
+ # Filters allow you to process content before it is sent to the client.
+ #
+ # To parse .shtml files for server-side includes (SSI):
+ # (You will also need to add "Includes" to the "Options" directive.)
+ #
+ AddType text/html .shtml
+ AddOutputFilter INCLUDES .shtml
+</IfModule>
+
+<IfModule mod_fcgid.c>
+ SharememPath /var/run/fcgid_shm
+ SocketPath /tmp/fcgidsock
+</IfModule>
+
+
+#
+# Action lets you define media types that will execute a script whenever
+# a matching file is called. This eliminates the need for repeated URL
+# pathnames for oft-used CGI file processors.
+# Format: Action media/type /cgi-script/location
+# Format: Action handler-name /cgi-script/location
+#
+
+#
+# Customizable error responses come in three flavors:
+# 1) plain text 2) local redirects 3) external redirects
+#
+# Some examples:
+#ErrorDocument 500 "The server made a boo boo."
+#ErrorDocument 404 /missing.html
+#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
+#ErrorDocument 402 http://www.example.com/subscription_info.html
+#
+
+#
+# Putting this all together, we can internationalize error responses.
+#
+# We use Alias to redirect any /error/HTTP_<error>.html.var response to
+# our collection of by-error message multi-language collections. We use
+# includes to substitute the appropriate text.
+#
+# You can modify the messages' appearance without changing any of the
+# default HTTP_<error>.html.var files by adding the line:
+#
+# Alias /error/include/ "/your/include/path/"
+#
+# which allows you to create your own set of files by starting with the
+# /usr/share/apache2/error/include/ files and copying them to /your/include/path/,
+# even on a per-VirtualHost basis. The default include files will display
+# your Apache version number and your ServerAdmin email address regardless
+# of the setting of ServerSignature.
+#
+# The internationalized error documents require mod_alias, mod_include
+# and mod_negotiation. To activate them, uncomment the following 30 lines.
+
+# Alias /error/ "/usr/share/apache2/error/"
+#
+# <Directory "/usr/share/apache2/error">
+# AllowOverride None
+# Options IncludesNoExec
+# AddOutputFilter Includes html
+# AddHandler type-map var
+# Order allow,deny
+# Allow from all
+# LanguagePriority en cs de es fr it nl sv pt-br ro
+# ForceLanguagePriority Prefer Fallback
+# </Directory>
+#
+# ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
+# ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
+# ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
+# ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
+# ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
+# ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
+# ErrorDocument 410 /error/HTTP_GONE.html.var
+# ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
+# ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
+# ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
+# ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
+# ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
+# ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
+# ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
+# ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
+# ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
+# ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var
+
+<IfModule mod_setenvif.c>
+ #
+ # The following directives modify normal HTTP response behavior to
+ # handle known problems with browser implementations.
+ #
+ BrowserMatch "Mozilla/2" nokeepalive
+ BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
+ BrowserMatch "RealPlayer 4\.0" force-response-1.0
+ BrowserMatch "Java/1\.0" force-response-1.0
+ BrowserMatch "JDK/1\.0" force-response-1.0
+
+ #
+ # The following directive disables redirects on non-GET requests for
+ # a directory that does not include the trailing slash. This fixes a
+ # problem with Microsoft WebFolders which does not appropriately handle
+ # redirects for folders with DAV methods.
+ # Same deal with Apple's DAV filesystem and Gnome VFS support for DAV.
+ #
+ BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
+ BrowserMatch "MS FrontPage" redirect-carefully
+ BrowserMatch "^WebDrive" redirect-carefully
+ BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
+ BrowserMatch "^gnome-vfs/1.0" redirect-carefully
+ BrowserMatch "^XML Spy" redirect-carefully
+ BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully
+</IfModule>
+
+#<IfModule mod_status.c>
+ #
+ # Allow server status reports generated by mod_status,
+ # with the URL of http://servername/server-status
+ # Change the ".example.com" to match your domain to enable.
+ #
+ #<Location /server-status>
+ # SetHandler server-status
+ # Order deny,allow
+ # Deny from all
+ # Allow from .example.com
+ #</Location>
+#</IfModule>
+
+#<IfModule mod_info.c>
+ #
+ # Allow remote server configuration reports, with the URL of
+ # http://servername/server-info (requires that mod_info.c be loaded).
+ # Change the ".example.com" to match your domain to enable.
+ #
+ #<Location /server-info>
+ # SetHandler server-info
+ # Order deny,allow
+ # Deny from all
+ # Allow from .example.com
+ #</Location>
+#</IfModule>
+
+# Include the virtual host configurations:
+Include <%= @node[:apache][:dir] %>/sites-enabled/
45 apache2/templates/default/default-site.erb
@@ -0,0 +1,45 @@
+<VirtualHost *:80>
+ ServerAdmin <%= @node[:apache][:contact] %>
+
+ DocumentRoot /var/www/
+ <Directory />
+ Options FollowSymLinks
+ AllowOverride None
+ </Directory>
+ <Directory /var/www/>
+ Options Indexes FollowSymLinks MultiViews
+ AllowOverride None
+ Order allow,deny
+ allow from all
+ # This directive allows us to have apache2's default start page
+ # in /apache2-default/, but still have / go to the right place
+ #RedirectMatch ^/$ /apache2-default/
+ </Directory>
+
+ ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
+ <Directory "/usr/lib/cgi-bin">
+ AllowOverride None
+ Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
+ Order allow,deny
+ Allow from all
+ </Directory>
+
+ ErrorLog /var/log/apache2/error.log
+
+ # Possible values include: debug, info, notice, warn, error, crit,
+ # alert, emerg.
+ LogLevel warn
+
+ CustomLog /var/log/apache2/access.log combined
+ ServerSignature On
+
+ Alias /doc/ "/usr/share/doc/"
+ <Directory "/usr/share/doc/">
+ Options Indexes MultiViews FollowSymLinks
+ AllowOverride None
+ Order deny,allow
+ Deny from all
+ Allow from 127.0.0.0/255.0.0.0 ::1/128
+ </Directory>
+
+</VirtualHost>
2 apache2/templates/default/port_apache.erb
@@ -0,0 +1,2 @@
+# Port <%= @port %>
+-A FWR -p tcp -m tcp --dport <%= @port %> -j ACCEPT
6 apache2/templates/default/ports.conf.erb
@@ -0,0 +1,6 @@
+#This file generated via template by Chef.
+<% @apache_listen_ports.each do |port| -%>
+Listen <%= port %>
+NameVirtualHost *:<%= port %>
+
+<% end -%>
31 apt/recipes/default.rb
@@ -0,0 +1,31 @@
+#
+# Cookbook Name:: apt
+# Recipe:: default
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+execute "apt-get-update" do
+ command "apt-get update"
+end
+
+%w{/var/cache/local /var/cache/local/preseeding}.each do |dirname|
+ directory dirname do
+ owner "root"
+ group "root"
+ mode 0644
+ action :create
+ end
+end
43 build-essential/recipes/default.rb
@@ -0,0 +1,43 @@
+#
+# Cookbook Name:: build-essential
+# Recipe:: default
+#
+# Copyright 2008, OpsCode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+case node[:platform]
+when "Ubuntu","Debian"
+ %w{build-essential binutils-doc}.each do |pkg|
+ package pkg do
+ action :install
+ end
+ end
+when "CentOS"
+ package "gcc" do
+ action :install
+ end
+end
+
+package "autoconf" do
+ action :install
+end
+
+package "flex" do
+ action :install
+end
+
+package "bison" do
+ action :install
+end
0 chef/recipes/default.rb
No changes.
40 chef/recipes/server.rb
@@ -0,0 +1,40 @@
+#
+# Author:: Joshua Timberman <joshua@opscode.com>
+# Cookbook Name:: chef
+# Recipe:: server
+#
+# Copyright 2008, OpsCode, Inc
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+runit_service "stompserver"
+
+package "couchdb"
+
+directory "/var/lib/couchdb" do
+ owner "couchdb"
+ group "couchdb"
+ recursive true
+end
+
+service "couchdb" do
+ supports :restart => true, :status => true
+ action :enable
+end
+
+runit_service "chef-indexer"
+runit_service "chef-server"
+
+["couchdb", "chef"].each do |port|
+ iptables_rule "port_#{port}"
+end
2 chef/templates/default/port_chef.erb