Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add Test Kitchen, ChefSpec, RuboCop, and Foodcritic on Travis CI

Signed-off-by: Seth Vargo <sethvargo@gmail.com>
commit 452e446841353de1f0da00c37cff8c5e95c41da3 1 parent 7b552ac
@sethvargo sethvargo authored
Showing with 1,669 additions and 1,608 deletions.
  1. +20 −2 .gitignore
  2. +15 −0 .rubocop.yml
  3. +9 −0 .travis.yml
  4. +7 −0 Berksfile
  5. +137 −157 CHANGELOG.md
  6. +20 −7 Gemfile
  7. +4 −2 README.md
  8. +53 −0 TESTING.md
  9. +115 −115 attributes/default.rb
  10. +21 −2 attributes/mod_auth_cas.rb
  11. +10 −9 attributes/mod_auth_openid.rb
  12. +5 −4 attributes/mod_fastcgi.rb
  13. +5 −4 attributes/mod_ssl.rb
  14. +4 −4 definitions/apache_conf.rb
  15. +16 −18 definitions/apache_module.rb
  16. +7 −7 definitions/apache_site.rb
  17. +13 −15 definitions/web_app.rb
  18. +1 −1  files/default/apache2_module_conf_generate.pl
  19. +2 −3 files/default/tests/minitest/default_test.rb
  20. +3 −3 files/default/tests/minitest/god_monitor_test.rb
  21. +3 −3 files/default/tests/minitest/mod_apreq2_test.rb
  22. +3 −4 files/default/tests/minitest/mod_auth_cas_test.rb
  23. +11 −12 files/default/tests/minitest/mod_auth_openid_test.rb
  24. +0 −1  files/default/tests/minitest/mod_cgi_test.rb
  25. +2 −3 files/default/tests/minitest/mod_dav_svn_test.rb
  26. +2 −3 files/default/tests/minitest/mod_fastcgi.rb
  27. +1 −2  files/default/tests/minitest/mod_include_test.rb
  28. +1 −2  files/default/tests/minitest/mod_perl_test.rb
  29. +2 −2 files/default/tests/minitest/mod_php5_test.rb
  30. +1 −2  files/default/tests/minitest/mod_python_test.rb
  31. +4 −5 files/default/tests/minitest/mod_ssl_test.rb
  32. +10 −9 files/default/tests/minitest/support/helpers.rb
  33. +224 −218 metadata.rb
  34. +92 −102 recipes/default.rb
  35. +9 −9 recipes/god_monitor.rb
  36. +2 −2 recipes/iptables.rb
  37. +2 −2 recipes/logrotate.rb
  38. +2 −2 recipes/mod_actions.rb
  39. +3 −3 recipes/mod_alias.rb
  40. +15 −18 recipes/mod_apreq2.rb
  41. +3 −3 recipes/mod_auth_basic.rb
  42. +36 −22 recipes/mod_auth_cas.rb
  43. +3 −3 recipes/mod_auth_digest.rb
  44. +30 −32 recipes/mod_auth_openid.rb
  45. +3 −3 recipes/mod_authn_file.rb
  46. +3 −3 recipes/mod_authnz_ldap.rb
  47. +3 −3 recipes/mod_authz_default.rb
  48. +3 −3 recipes/mod_authz_groupfile.rb
  49. +3 −3 recipes/mod_authz_host.rb
  50. +3 −3 recipes/mod_authz_user.rb
  51. +3 −3 recipes/mod_autoindex.rb
  52. +2 −2 recipes/mod_cgi.rb
  53. +8 −8 recipes/mod_cloudflare.rb
  54. +2 −2 recipes/mod_dav.rb
  55. +3 −3 recipes/mod_dav_fs.rb
  56. +7 −9 recipes/mod_dav_svn.rb
  57. +3 −3 recipes/mod_deflate.rb
  58. +3 −3 recipes/mod_dir.rb
  59. +3 −3 recipes/mod_env.rb
  60. +3 −3 recipes/mod_expires.rb
  61. +29 −37 recipes/mod_fastcgi.rb
  62. +11 −13 recipes/mod_fcgid.rb
  63. +1 −1  recipes/mod_filter.rb
  64. +3 −3 recipes/mod_headers.rb
  65. +2 −2 recipes/mod_include.rb
  66. +3 −3 recipes/mod_ldap.rb
  67. +4 −4 recipes/mod_log_config.rb
  68. +4 −4 recipes/mod_logio.rb
  69. +3 −3 recipes/mod_mime.rb
  70. +3 −3 recipes/mod_negotiation.rb
  71. +8 −12 recipes/mod_perl.rb
  72. +28 −37 recipes/mod_php5.rb
  73. +3 −3 recipes/mod_proxy.rb
  74. +4 −4 recipes/mod_proxy_ajp.rb
  75. +3 −3 recipes/mod_proxy_balancer.rb
  76. +3 −3 recipes/mod_proxy_connect.rb
  77. +3 −3 recipes/mod_proxy_http.rb
  78. +7 −10 recipes/mod_python.rb
  79. +3 −3 recipes/mod_rewrite.rb
  80. +3 −3 recipes/mod_setenvif.rb
  81. +11 −12 recipes/mod_ssl.rb
  82. +3 −3 recipes/mod_status.rb
  83. +1 −1  recipes/mod_userdir.rb
  84. +7 −11 recipes/mod_wsgi.rb
  85. +7 −11 recipes/mod_xsendfile.rb
  86. +8 −8 templates/default/apache2.conf.erb
  87. +53 −55 templates/default/default-site.erb
  88. +16 −17 templates/default/mods/alias.conf.erb
  89. +1 −1  templates/default/mods/auth_cas.conf.erb
  90. +87 −88 templates/default/mods/autoindex.conf.erb
  91. +14 −14 templates/default/mods/deflate.conf.erb
  92. +1 −3 templates/default/mods/dir.conf.erb
  93. +1 −1  templates/default/mods/fcgid.conf.erb
  94. +8 −8 templates/default/mods/info.conf.erb
  95. +188 −190 templates/default/mods/mime.conf.erb
  96. +14 −15 templates/default/mods/negotiation.conf.erb
  97. +13 −13 templates/default/mods/proxy.conf.erb
  98. +23 −25 templates/default/mods/setenvif.conf.erb
  99. +67 −68 templates/default/mods/ssl.conf.erb
  100. +20 −21 templates/default/mods/status.conf.erb
  101. +1 −1  templates/default/ports.conf.erb
  102. +3 −7 templates/default/security.erb
  103. +11 −7 test/features/step_definitions/webserver_steps.rb
View
22 .gitignore
@@ -1,3 +1,21 @@
-test/kitchen/.kitchen/
-
+*~
+*#
+.#*
+\#*#
+.*.sw[a-z]
+*.un~
+*.tmp
+*.bk
+*.bkup
+.kitchen.local.yml
+Berksfile.lock
Gemfile.lock
+
+.bundle/
+.cache/
+.kitchen/
+.vagrant/
+.vagrant.d/
+bin/
+tmp/
+vendor/
View
15 .rubocop.yml
@@ -0,0 +1,15 @@
+AllCops:
+ Excludes:
+ - test/**
+ - vendor/**
+
+AlignParameters:
+ Enabled: false
+Encoding:
+ Enabled: false
+HashSyntax:
+ Enabled: false
+LineLength:
+ Enabled: false
+MethodLength:
+ Max: 30
View
9 .travis.yml
@@ -0,0 +1,9 @@
+rvm:
+ - 1.9.3
+ - 2.0.0
+before_script:
+ - bundle exec berks install
+script:
+ - bundle exec foodcritic -f any . --tags ~FC007 --tags ~FC015 --tags ~FC023
+ # - bundle exec rspec --color --format progress
+ - bundle exec rubocop
View
7 Berksfile
@@ -0,0 +1,7 @@
+site :opscode
+metadata
+
+group :integration do
+ cookbook 'apt', '~> 2.0'
+ cookbook 'yum', '~> 2.0'
+end
View
294 CHANGELOG.md
@@ -1,5 +1,9 @@
-## v1.7.0:
+apache2 Cookbook Changelog
+==========================
+This file is used to list changes made in each version of the apache2 cookbook.
+v1.7.0
+------
### Improvement
- [COOK-3073]: make access.log location configurable per-platform
@@ -11,173 +15,149 @@
- [COOK-3184]: Add `mod_filter` recipe to Apache2-cookbook
- [COOK-3236]: Add `mod_action` recipe to Apache2-cookbook
-## v1.6.6:
-
+v1.6.6
+------
1.6.4 had a missed step in the automated release, long live 1.6.6.
### Bug
-- [COOK-3018]: apache2_module does duplicate delayed restart of
- apache2 service when conf = true
-- [COOK-3027]: Default site enable true, then false, does not disable
- default site
+- [COOK-3018]: apache2_module does duplicate delayed restart of apache2 service when conf = true
+- [COOK-3027]: Default site enable true, then false, does not disable default site
- [COOK-3109]: fix apache lib_dir arch attribute regexp
-## v1.6.2
-
-* [COOK-2535] - `mod_auth_openid` requires libtool to run autogen.sh
-* [COOK-2667] - Typo in usage documentation
-* [COOK-2461] - `apache2::mod_auth_openid` fails on some ubuntu systems
-* [COOK-2720] - Apache2 minitest helper function `ran_recipe` is not
- portable
-
-## v1.6.0:
-
-* [COOK-2372] - apache2 mpm_worker: add ServerLimit attribute (default
- to 16)
-
-## v1.5.0:
-
-**NOTE** The `mod_auth_openid` attributes are changed. The upstream
- maintainer deprecated the older release versions, and the source
- repository has releases available at specific SHA1SUM references.
- The new attribute, `node['apache']['mod_auth_openid']['ref']` is
- used to set this.
-
-* [COOK-2198] - `apache::mod_auth_openid` compiles from source, but
- does not install make on debian/ubuntu
-* [COOK-2224] - version conflict between cucumber and other gems
-* [COOK-2248] - `apache2::mod_php5` uses `not_if` "which php" without
- ensuring package 'which' is installed
-* [COOK-2269] - Set allow list for mod_status incase external monitor scripts need
-* [COOK-2276] - cookbook apache2 documentation regarding listening
- ports doesn't match default attributes
-* [COOK-2296] - `mod_auth_openid` doesn't have tags/releases for the
- version I need for features and fixes
-* [COOK-2323] - Add Oracle linux support
-
-## v1.4.2:
-
-* [COOK-1721] - fix logrotate recipe
-
-## v1.4.0:
-
-* [COOK-1456] - iptables enhancements
-* [COOK-1473] - apache2 does not disable default site when setting
- "`default_site_enabled`" back to false
-* [COOK-1824] - the apache2 cookbook needs to specify which binary is
- used on rhel platform
-* [COOK-1916] - Download location wrong for apache2 `mod_auth_openid`
- >= 0.7
-* [COOK-1917] - Improve `mod_auth_openid` recipe to handle module
- upgrade more gracefully
-* [COOK-2029] - apache2 restarts on every run on RHEL and friends,
- generate-module-list on every run.
-* [COOK-2036] - apache2: Cookbook style
-
-## v1.3.2:
-
-* [COOK-1804] - fix `web_app` definition parameter so site can be
- disabled.
-
-## v1.3.0:
-
-* [COOK-1738] - Better configuration for `mod_include` and some
- overrides in `web_app` definition
-* [COOK-1470] - Change SSL Ciphers to Mitigate BEAST attack
-
-## v1.2.0:
-
-* [COOK-692] - delete package conf.d files in module recipes, for EL
-* [COOK-1693] - Foodcritic finding for unnecessary string interpolation
-* [COOK-1757] - platform_family and better style / usage practices
-
-## v1.1.16:
-
+v1.6.2
+------
+- [COOK-2535] - `mod_auth_openid` requires libtool to run autogen.sh
+- [COOK-2667] - Typo in usage documentation
+- [COOK-2461] - `apache2::mod_auth_openid` fails on some ubuntu systems
+- [COOK-2720] - Apache2 minitest helper function `ran_recipe` is not portable
+
+v1.6.0
+------
+- [COOK-2372] - apache2 mpm_worker: add ServerLimit attribute (default to 16)
+
+v1.5.0
+------
+The `mod_auth_openid` attributes are changed. The upstream maintainer deprecated the older release versions, and the source repository has releases available at specific SHA1SUM references. The new attribute, `node['apache']['mod_auth_openid']['ref']` is used to set this.
+
+- [COOK-2198] - `apache::mod_auth_openid` compiles from source, but does not install make on debian/ubuntu
+- [COOK-2224] - version conflict between cucumber and other gems
+- [COOK-2248] - `apache2::mod_php5` uses `not_if` "which php" without ensuring package 'which' is installed
+- [COOK-2269] - Set allow list for mod_status incase external monitor scripts need
+- [COOK-2276] - cookbook apache2 documentation regarding listening ports doesn't match default attributes
+- [COOK-2296] - `mod_auth_openid` doesn't have tags/releases for the version I need for features and fixes
+- [COOK-2323] - Add Oracle linux support
+
+v1.4.2
+------
+- [COOK-1721] - fix logrotate recipe
+
+v1.4.0
+------
+- [COOK-1456] - iptables enhancements
+- [COOK-1473] - apache2 does not disable default site when setting "`default_site_enabled`" back to false
+- [COOK-1824] - the apache2 cookbook needs to specify which binary is used on rhel platform
+- [COOK-1916] - Download location wrong for apache2 `mod_auth_openid` >= 0.7
+- [COOK-1917] - Improve `mod_auth_openid` recipe to handle module upgrade more gracefully
+- [COOK-2029] - apache2 restarts on every run on RHEL and friends, generate-module-list on every run.
+- [COOK-2036] - apache2: Cookbook style
+
+v1.3.2
+------
+- [COOK-1804] - fix `web_app` definition parameter so site can be disabled.
+
+v1.3.0
+------
+- [COOK-1738] - Better configuration for `mod_include` and some overrides in `web_app` definition
+- [COOK-1470] - Change SSL Ciphers to Mitigate BEAST attack
+
+v1.2.0
+------
+- [COOK-692] - delete package conf.d files in module recipes, for EL
+- [COOK-1693] - Foodcritic finding for unnecessary string interpolation
+- [COOK-1757] - platform_family and better style / usage practices
+
+v1.1.16
+-------
re-releasing as .16 due to error on tag 1.1.14
-* [COOK-1466] - add `mod_auth_cas` recipe
-* [COOK-1609] - apache2 changes ports.conf twice per run when using
- apache2::mod_ssl
-
-## v1.1.12:
+- [COOK-1466] - add `mod_auth_cas` recipe
+- [COOK-1609] - apache2 changes ports.conf twice per run when using apache2::mod_ssl
-* [COOK-1436] - restore apache2 web_app definition
-* [COOK-1356] - allow ExtendedStatus via attribute
-* [COOK-1403] - add mod_fastcgi recipe
+v1.1.12
+-------
+- [COOK-1436] - restore apache2 web_app definition
+- [COOK-1356] - allow ExtendedStatus via attribute
+- [COOK-1403] - add mod_fastcgi recipe
-## v1.1.10:
+v1.1.10
+-------
+- [COOK-1315] - allow the default site to not be enabled
+- [COOK-1328] - cookbook tests (minitest, cucumber)
-* [COOK-1315] - allow the default site to not be enabled
-* [COOK-1328] - cookbook tests (minitest, cucumber)
-
-## v1.1.8:
-
-* Some platforms with minimal installations that don't have perl won't
- have a `node['languages']['perl']` attribute, so remove the
- conditional and rely on the power of idempotence in the package
- resource.
-* [COOK-1214] - address foodcritic warnings
-* [COOK-1180] - add `mod_logio` and fix `mod_proxy`
-
-## v1.1.6:
+v1.1.8
+------
+- Some platforms with minimal installations that don't have perl won't have a `node['languages']['perl']` attribute, so remove the conditional and rely on the power of idempotence in the package resource.
+- [COOK-1214] - address foodcritic warnings
+- [COOK-1180] - add `mod_logio` and fix `mod_proxy`
+v1.1.6
+------
FreeBSD users: This release requires the `freebsd` cookbook. See README.md.
-* [COOK-1025] - freebsd support in mod_php5 recipe
-
-## v1.1.4:
-
-* [COOK-1100] - support amazon linux
-
-## v1.1.2:
-
-* [COOK-996] - apache2::mod_php5 can cause PHP and module API mismatches
-* [COOK-1083] - return string for v_f_p and use correct value for
- default
-
-## v1.1.0:
-
-* [COOK-861] - Add `mod_perl` and apreq2
-* [COOK-941] - fix `mod_auth_openid` on FreeBSD
-* [COOK-1021] - add a commented-out LoadModule directive to keep apxs happy
-* [COOK-1022] - consistency for icondir attribute
-* [COOK-1023] - fix platform test for attributes
-* [COOK-1024] - fix a2enmod script so it runs cleanly on !bash
-* [COOK-1026] - fix `error_log` location on FreeBSD
-
-## v1.0.8:
-
-* COOK-548 - directory resource doesn't have backup parameter
-
-## v1.0.6:
-
-* COOK-915 - update to `mod_auth_openid` version 0.6, see __Recipes/mod_auth_openid__ below.
-* COOK-548 - Add support for FreeBSD.
-
-## v1.0.4:
-
-* COOK-859 - don't hardcode module paths
-
-## v1.0.2
-
-* Tickets resolved in this release: COOK-788, COOK-782, COOK-780
-
-## v1.0.0
-
-* Red Hat family support is greatly improved, all recipes except `god_monitor` converge.
-* Recipe `mod_auth_openid` now works on RHEL family distros
-* Recipe `mod_php5` will now remove config from package on RHEL family so it doesn't conflict with the cookbook's.
-* Added `php5.conf.erb` template for `mod_php5` recipe.
-* Create the run state directory for `mod_fcgid` to prevent a startup error on RHEL version 6.
-* New attribute `node['apache']['lib_dir']` to handle lib vs lib64 on RHEL family distributions.
-* New attribute `node['apache']['group']`.
-* Scientific Linux support added.
-* Use a file resource instead of the generate-module-list executed perl script on RHEL family.
-* "default" site can now be disabled.
-* web_app now has an "enable" parameter.
-* Support for dav_fs apache module.
-* Tickets resolved in this release: COOK-754, COOK-753, COOK-665, COOK-624, COOK-579, COOK-519, COOK-518
-* Fix node references in template for a2dissite
-* Use proper user and group attributes on files and templates.
-* Replace the anemic README.rdoc with this new and improved superpowered README.md :).
+- [COOK-1025] - freebsd support in mod_php5 recipe
+
+v1.1.4
+------
+- [COOK-1100] - support amazon linux
+
+v1.1.2
+------
+- [COOK-996] - apache2::mod_php5 can cause PHP and module API mismatches
+- [COOK-1083] - return string for v_f_p and use correct value for default
+
+v1.1.0
+------
+- [COOK-861] - Add `mod_perl` and apreq2
+- [COOK-941] - fix `mod_auth_openid` on FreeBSD
+- [COOK-1021] - add a commented-out LoadModule directive to keep apxs happy
+- [COOK-1022] - consistency for icondir attribute
+- [COOK-1023] - fix platform test for attributes
+- [COOK-1024] - fix a2enmod script so it runs cleanly on !bash
+- [COOK-1026] - fix `error_log` location on FreeBSD
+
+v1.0.8
+------
+- COOK-548 - directory resource doesn't have backup parameter
+
+v1.0.6
+------
+- COOK-915 - update to `mod_auth_openid` version 0.6, see __Recipes/mod_auth_openid__ below.
+- COOK-548 - Add support for FreeBSD.
+
+v1.0.4
+------
+- COOK-859 - don't hardcode module paths
+
+v1.0.2
+------
+- Tickets resolved in this release: COOK-788, COOK-782, COOK-780
+
+v1.0.0
+------
+- Red Hat family support is greatly improved, all recipes except `god_monitor` converge.
+- Recipe `mod_auth_openid` now works on RHEL family distros
+- Recipe `mod_php5` will now remove config from package on RHEL family so it doesn't conflict with the cookbook's.
+- Added `php5.conf.erb` template for `mod_php5` recipe.
+- Create the run state directory for `mod_fcgid` to prevent a startup error on RHEL version 6.
+- New attribute `node['apache']['lib_dir']` to handle lib vs lib64 on RHEL family distributions.
+- New attribute `node['apache']['group']`.
+- Scientific Linux support added.
+- Use a file resource instead of the generate-module-list executed perl script on RHEL family.
+- "default" site can now be disabled.
+- web_app now has an "enable" parameter.
+- Support for dav_fs apache module.
+- Tickets resolved in this release: COOK-754, COOK-753, COOK-665, COOK-624, COOK-579, COOK-519, COOK-518
+- Fix node references in template for a2dissite
+- Use proper user and group attributes on files and templates.
+- Replace the anemic README.rdoc with this new and improved superpowered README.md :).
View
27 Gemfile
@@ -1,10 +1,23 @@
-source "https://rubygems.org"
+# source "https://rubygems.org"
-gem 'cucumber', '~> 1.2.0'
-gem 'httparty', '~> 0.8.3'
-gem 'minitest', '~> 3.0.0'
-gem 'nokogiri', '~> 1.5.0'
+# gem 'cucumber', '~> 1.2.0'
+# gem 'httparty', '~> 0.8.3'
+# gem 'minitest', '~> 3.0.0'
+# gem 'nokogiri', '~> 1.5.0'
-group :kitchen do
- gem 'test-kitchen', '< 1.0'
+# group :kitchen do
+# gem 'test-kitchen', '< 1.0'
+# end
+
+
+source 'https://rubygems.org'
+
+gem 'berkshelf', '~> 2.0'
+gem 'chefspec', '~> 2.0'
+gem 'foodcritic', '~> 3.0'
+gem 'rubocop', '~> 0.12'
+
+group :integration do
+ gem 'test-kitchen', '~> 1.0.0.beta'
+ gem 'kitchen-vagrant', '~> 0.11'
end
View
6 README.md
@@ -1,5 +1,7 @@
-Description
-===========
+apache2 Cookbook
+================
+[![Build Status](https://secure.travis-ci.org/opscode-cookbooks/apache2.png?branch=master)](http://travis-ci.org/opscode-cookbooks/apache2)
+
This cookbook provides a complete Debian/Ubuntu style Apache HTTPD
configuration. Non-Debian based distributions such as Red Hat/CentOS,
View
53 TESTING.md
@@ -0,0 +1,53 @@
+This cookbook uses a variety of testing components:
+
+- Unit tests: [ChefSpec](https://github.com/acrmp/chefspec)
+- Integration tests: [Test Kitchen](https://github.com/opscode/test-kitchen)
+- Chef Style lints: [Foodcritic](https://github.com/acrmp/foodcritic)
+- Ruby Style lints: [Rubocop](https://github.com/bbatsov/rubocop)
+
+
+Prerequisites
+-------------
+To develop on this cookbook, you must have a sane Ruby 1.9+ environment. Given the nature of this installation process (and it's variance across multiple operating systems), we will leave this installation process to the user.
+
+You must also have `bundler` installed:
+
+ $ gem install bundler
+
+You must also have Vagrant and VirtualBox installed:
+
+- [Vagrant](https://vagrantup.com)
+- [VirtualBox](https://virtualbox.org)
+
+Once installed, you must install the `vagrant-berkshelf` plugin:
+
+ $ vagrant plugin install vagrant-berkshelf
+
+
+Development
+-----------
+1. Clone the git repository from GitHub:
+
+ $ git clone git@github.com:opscode-cookbooks/COOKBOOK.git
+
+2. Install the dependencies using bundler:
+
+ $ bundle install
+
+3. Create a branch for your changes:
+
+ $ git checkout -b my_bug_fix
+
+4. Make any changes
+5. Write tests to support those changes. It is highly recommended you write both unit and integration tests.
+6. Run the tests:
+ - `bundle exec rspec`
+ - `bundle exec foodcritic .`
+ - `bundle exec rubocop`
+ - `bundle exec kitchen test`
+
+7. Assuming the tests pass, open a Pull Request on GitHub
+8. Open a JIRA ticket for this compontent, linking the JIRA ticket to the Pull Request and visa versa.
+9. Mark the JIRA ticket as "Fix Provided"
+
+For more information, see [Opscode's Contribution Guidelines](https://wiki.opscode.com/display/chef/How+to+Contribute).
View
230 attributes/default.rb
@@ -2,7 +2,7 @@
# Cookbook Name:: apache2
# Attributes:: apache
#
-# Copyright 2008-2009, Opscode, Inc.
+# Copyright 2008-2013, Opscode, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -17,98 +17,98 @@
# limitations under the License.
#
-default['apache']['root_group'] = "root"
+default['apache']['root_group'] = 'root'
# Where the various parts of apache are
-case platform
-when "redhat", "centos", "scientific", "fedora", "suse", "amazon", "oracle"
- default['apache']['package'] = "httpd"
- default['apache']['dir'] = "/etc/httpd"
- default['apache']['log_dir'] = "/var/log/httpd"
- default['apache']['error_log'] = "error.log"
- default['apache']['access_log'] = "access.log"
- default['apache']['user'] = "apache"
- default['apache']['group'] = "apache"
- default['apache']['binary'] = "/usr/sbin/httpd"
- default['apache']['docroot_dir'] = "/var/www/html"
- default['apache']['cgibin_dir'] = "/var/www/cgi-bin"
- default['apache']['icondir'] = "/var/www/icons"
- default['apache']['cache_dir'] = "/var/cache/httpd"
- if node['platform_version'].to_f >= 6 then
- default['apache']['pid_file'] = "/var/run/httpd/httpd.pid"
- else
- default['apache']['pid_file'] = "/var/run/httpd.pid"
- end
- default['apache']['lib_dir'] = node['kernel']['machine'] =~ /^i[36]86$/ ? "/usr/lib/httpd" : "/usr/lib64/httpd"
- default['apache']['libexecdir'] = "#{node['apache']['lib_dir']}/modules"
+case node['platform']
+when 'redhat', 'centos', 'scientific', 'fedora', 'suse', 'amazon', 'oracle'
+ default['apache']['package'] = 'httpd'
+ default['apache']['dir'] = '/etc/httpd'
+ default['apache']['log_dir'] = '/var/log/httpd'
+ default['apache']['error_log'] = 'error.log'
+ default['apache']['access_log'] = 'access.log'
+ default['apache']['user'] = 'apache'
+ default['apache']['group'] = 'apache'
+ default['apache']['binary'] = '/usr/sbin/httpd'
+ default['apache']['docroot_dir'] = '/var/www/html'
+ default['apache']['cgibin_dir'] = '/var/www/cgi-bin'
+ default['apache']['icondir'] = '/var/www/icons'
+ default['apache']['cache_dir'] = '/var/cache/httpd'
+ default['apache']['pid_file'] = if node['platform_version'].to_f >= 6
+ '/var/run/httpd/httpd.pid'
+ else
+ '/var/run/httpd.pid'
+ end
+ default['apache']['lib_dir'] = node['kernel']['machine'] =~ /^i[36]86$/ ? '/usr/lib/httpd' : '/usr/lib64/httpd'
+ default['apache']['libexecdir'] = "#{node['apache']['lib_dir']}/modules"
default['apache']['default_site_enabled'] = false
-when "debian", "ubuntu"
- default['apache']['package'] = "apache2"
- default['apache']['dir'] = "/etc/apache2"
- default['apache']['log_dir'] = "/var/log/apache2"
- default['apache']['error_log'] = "error.log"
- default['apache']['access_log'] = "access.log"
- default['apache']['user'] = "www-data"
- default['apache']['group'] = "www-data"
- default['apache']['binary'] = "/usr/sbin/apache2"
- default['apache']['docroot_dir'] = "/var/www"
- default['apache']['cgibin_dir'] = "/usr/lib/cgi-bin"
- default['apache']['icondir'] = "/usr/share/apache2/icons"
- default['apache']['cache_dir'] = "/var/cache/apache2"
- default['apache']['pid_file'] = "/var/run/apache2.pid"
- default['apache']['lib_dir'] = "/usr/lib/apache2"
- default['apache']['libexecdir'] = "#{node['apache']['lib_dir']}/modules"
+when 'debian', 'ubuntu'
+ default['apache']['package'] = 'apache2'
+ default['apache']['dir'] = '/etc/apache2'
+ default['apache']['log_dir'] = '/var/log/apache2'
+ default['apache']['error_log'] = 'error.log'
+ default['apache']['access_log'] = 'access.log'
+ default['apache']['user'] = 'www-data'
+ default['apache']['group'] = 'www-data'
+ default['apache']['binary'] = '/usr/sbin/apache2'
+ default['apache']['docroot_dir'] = '/var/www'
+ default['apache']['cgibin_dir'] = '/usr/lib/cgi-bin'
+ default['apache']['icondir'] = '/usr/share/apache2/icons'
+ default['apache']['cache_dir'] = '/var/cache/apache2'
+ default['apache']['pid_file'] = '/var/run/apache2.pid'
+ default['apache']['lib_dir'] = '/usr/lib/apache2'
+ default['apache']['libexecdir'] = "#{node['apache']['lib_dir']}/modules"
default['apache']['default_site_enabled'] = false
-when "arch"
- default['apache']['package'] = "apache"
- default['apache']['dir'] = "/etc/httpd"
- default['apache']['log_dir'] = "/var/log/httpd"
- default['apache']['error_log'] = "error.log"
- default['apache']['access_log'] = "access.log"
- default['apache']['user'] = "http"
- default['apache']['group'] = "http"
- default['apache']['binary'] = "/usr/sbin/httpd"
- default['apache']['docroot_dir'] = "/srv/http"
- default['apache']['cgibin_dir'] = "/usr/share/httpd/cgi-bin"
- default['apache']['icondir'] = "/usr/share/httpd/icons"
- default['apache']['cache_dir'] = "/var/cache/httpd"
- default['apache']['pid_file'] = "/var/run/httpd/httpd.pid"
- default['apache']['lib_dir'] = "/usr/lib/httpd"
- default['apache']['libexecdir'] = "#{node['apache']['lib_dir']}/modules"
+when 'arch'
+ default['apache']['package'] = 'apache'
+ default['apache']['dir'] = '/etc/httpd'
+ default['apache']['log_dir'] = '/var/log/httpd'
+ default['apache']['error_log'] = 'error.log'
+ default['apache']['access_log'] = 'access.log'
+ default['apache']['user'] = 'http'
+ default['apache']['group'] = 'http'
+ default['apache']['binary'] = '/usr/sbin/httpd'
+ default['apache']['docroot_dir'] = '/srv/http'
+ default['apache']['cgibin_dir'] = '/usr/share/httpd/cgi-bin'
+ default['apache']['icondir'] = '/usr/share/httpd/icons'
+ default['apache']['cache_dir'] = '/var/cache/httpd'
+ default['apache']['pid_file'] = '/var/run/httpd/httpd.pid'
+ default['apache']['lib_dir'] = '/usr/lib/httpd'
+ default['apache']['libexecdir'] = "#{node['apache']['lib_dir']}/modules"
default['apache']['default_site_enabled'] = false
-when "freebsd"
- default['apache']['package'] = "apache22"
- default['apache']['dir'] = "/usr/local/etc/apache22"
- default['apache']['log_dir'] = "/var/log"
- default['apache']['error_log'] = "httpd-error.log"
- default['apache']['access_log'] = "httpd-access.log"
- default['apache']['root_group'] = "wheel"
- default['apache']['user'] = "www"
- default['apache']['group'] = "www"
- default['apache']['binary'] = "/usr/local/sbin/httpd"
- default['apache']['docroot_dir'] = "/usr/local/www/apache22/data"
- default['apache']['cgibin_dir'] = "/usr/local/www/apache22/cgi-bin"
- default['apache']['icondir'] = "/usr/local/www/apache22/icons"
- default['apache']['cache_dir'] = "/var/run/apache22"
- default['apache']['pid_file'] = "/var/run/httpd.pid"
- default['apache']['lib_dir'] = "/usr/local/libexec/apache22"
- default['apache']['libexecdir'] = node['apache']['lib_dir']
+when 'freebsd'
+ default['apache']['package'] = 'apache22'
+ default['apache']['dir'] = '/usr/local/etc/apache22'
+ default['apache']['log_dir'] = '/var/log'
+ default['apache']['error_log'] = 'httpd-error.log'
+ default['apache']['access_log'] = 'httpd-access.log'
+ default['apache']['root_group'] = 'wheel'
+ default['apache']['user'] = 'www'
+ default['apache']['group'] = 'www'
+ default['apache']['binary'] = '/usr/local/sbin/httpd'
+ default['apache']['docroot_dir'] = '/usr/local/www/apache22/data'
+ default['apache']['cgibin_dir'] = '/usr/local/www/apache22/cgi-bin'
+ default['apache']['icondir'] = '/usr/local/www/apache22/icons'
+ default['apache']['cache_dir'] = '/var/run/apache22'
+ default['apache']['pid_file'] = '/var/run/httpd.pid'
+ default['apache']['lib_dir'] = '/usr/local/libexec/apache22'
+ default['apache']['libexecdir'] = node['apache']['lib_dir']
default['apache']['default_site_enabled'] = false
else
- default['apache']['dir'] = "/etc/apache2"
- default['apache']['log_dir'] = "/var/log/apache2"
- default['apache']['error_log'] = "error.log"
- default['apache']['access_log'] = "access.log"
- default['apache']['user'] = "www-data"
- default['apache']['group'] = "www-data"
- default['apache']['binary'] = "/usr/sbin/apache2"
- default['apache']['docroot_dir'] = "/var/www"
- default['apache']['cgibin_dir'] = "/usr/lib/cgi-bin"
- default['apache']['icondir'] = "/usr/share/apache2/icons"
- default['apache']['cache_dir'] = "/var/cache/apache2"
- default['apache']['pid_file'] = "logs/httpd.pid"
- default['apache']['lib_dir'] = "/usr/lib/apache2"
- default['apache']['libexecdir'] = "#{node['apache']['lib_dir']}/modules"
+ default['apache']['dir'] = '/etc/apache2'
+ default['apache']['log_dir'] = '/var/log/apache2'
+ default['apache']['error_log'] = 'error.log'
+ default['apache']['access_log'] = 'access.log'
+ default['apache']['user'] = 'www-data'
+ default['apache']['group'] = 'www-data'
+ default['apache']['binary'] = '/usr/sbin/apache2'
+ default['apache']['docroot_dir'] = '/var/www'
+ default['apache']['cgibin_dir'] = '/usr/lib/cgi-bin'
+ default['apache']['icondir'] = '/usr/share/apache2/icons'
+ default['apache']['cache_dir'] = '/var/cache/apache2'
+ default['apache']['pid_file'] = 'logs/httpd.pid'
+ default['apache']['lib_dir'] = '/usr/lib/apache2'
+ default['apache']['libexecdir'] = "#{node['apache']['lib_dir']}/modules"
default['apache']['default_site_enabled'] = false
end
@@ -118,24 +118,24 @@
###
# General settings
-default['apache']['listen_addresses'] = ["*"]
-default['apache']['listen_ports'] = ["80"]
-default['apache']['contact'] = "ops@example.com"
-default['apache']['timeout'] = 300
-default['apache']['keepalive'] = "On"
+default['apache']['listen_addresses'] = %w[*]
+default['apache']['listen_ports'] = %w[80]
+default['apache']['contact'] = 'ops@example.com'
+default['apache']['timeout'] = 300
+default['apache']['keepalive'] = 'On'
default['apache']['keepaliverequests'] = 100
-default['apache']['keepalivetimeout'] = 5
+default['apache']['keepalivetimeout'] = 5
# Security
-default['apache']['servertokens'] = "Prod"
-default['apache']['serversignature'] = "On"
-default['apache']['traceenable'] = "On"
+default['apache']['servertokens'] = 'Prod'
+default['apache']['serversignature'] = 'On'
+default['apache']['traceenable'] = 'On'
# mod_auth_openids
-default['apache']['allowed_openids'] = Array.new
+default['apache']['allowed_openids'] = []
# mod_status Allow list, space seprated list of allowed entries.
-default['apache']['status_allow_list'] = "localhost ip6-localhost"
+default['apache']['status_allow_list'] = 'localhost ip6-localhost'
# mod_status ExtendedStatus, set to 'true' to enable
default['apache']['ext_status'] = false
@@ -144,34 +144,34 @@
default['apache']['info_allow_list'] = 'localhost ip6-localhost'
# Prefork Attributes
-default['apache']['prefork']['startservers'] = 16
-default['apache']['prefork']['minspareservers'] = 16
-default['apache']['prefork']['maxspareservers'] = 32
-default['apache']['prefork']['serverlimit'] = 400
-default['apache']['prefork']['maxclients'] = 400
-default['apache']['prefork']['maxrequestsperchild'] = 10000
+default['apache']['prefork']['startservers'] = 16
+default['apache']['prefork']['minspareservers'] = 16
+default['apache']['prefork']['maxspareservers'] = 32
+default['apache']['prefork']['serverlimit'] = 400
+default['apache']['prefork']['maxclients'] = 400
+default['apache']['prefork']['maxrequestsperchild'] = 10_000
# Worker Attributes
-default['apache']['worker']['startservers'] = 4
-default['apache']['worker']['serverlimit'] = 16
-default['apache']['worker']['maxclients'] = 1024
-default['apache']['worker']['minsparethreads'] = 64
-default['apache']['worker']['maxsparethreads'] = 192
-default['apache']['worker']['threadsperchild'] = 64
+default['apache']['worker']['startservers'] = 4
+default['apache']['worker']['serverlimit'] = 16
+default['apache']['worker']['maxclients'] = 1024
+default['apache']['worker']['minsparethreads'] = 64
+default['apache']['worker']['maxsparethreads'] = 192
+default['apache']['worker']['threadsperchild'] = 64
default['apache']['worker']['maxrequestsperchild'] = 0
# mod_proxy settings
-default['apache']['proxy']['order'] = 'deny,allow'
-default['apache']['proxy']['deny_from'] = 'all'
+default['apache']['proxy']['order'] = 'deny,allow'
+default['apache']['proxy']['deny_from'] = 'all'
default['apache']['proxy']['allow_from'] = 'none'
# Default modules to enable via include_recipe
-default['apache']['default_modules'] = %w{
+default['apache']['default_modules'] = %w[
status alias auth_basic authn_file authz_default authz_groupfile authz_host authz_user autoindex
dir env mime negotiation setenvif
-}
+]
-%w{ log_config logio }.each do |log_mod|
- default['apache']['default_modules'] << log_mod if ["rhel", "fedora", "suse", "arch", "freebsd"].include?(node['platform_family'])
+%w[log_config logio].each do |log_mod|
+ default['apache']['default_modules'] << log_mod if %w[rhel fedora suse arch freebsd].include?(node['platform_family'])
end
View
23 attributes/mod_auth_cas.rb
@@ -1,2 +1,21 @@
-default['apache']['mod_auth_cas']['from_source'] = false
-default['apache']['mod_auth_cas']['source_revision'] = "v1.0.8.1"
+#
+# Cookbook Name:: apache2
+# Attributes:: mod_auth_cas
+#
+# Copyright 2013, 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.
+#
+
+default['apache']['mod_auth_cas']['from_source'] = false
+default['apache']['mod_auth_cas']['source_revision'] = 'v1.0.8.1'
View
19 attributes/mod_auth_openid.rb
@@ -1,13 +1,14 @@
#
-# Author:: Joshua Timberman <joshua@opscode.com>
-# Copyright:: Copyright (c) 2011, Opscode, Inc.
-# License:: Apache License, Version 2.0
+# Cookbook Name:: apache2
+# Attributes:: mod_auth_cas
+#
+# Copyright 2013, 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
+# 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,
@@ -16,16 +17,16 @@
# limitations under the License.
#
-default['apache']['mod_auth_openid']['ref'] = "95043901eab868400937642d9bc55d17e9dd069f"
+default['apache']['mod_auth_openid']['ref'] = '95043901eab868400937642d9bc55d17e9dd069f'
default['apache']['mod_auth_openid']['source_url'] = "https://github.com/bmuller/mod_auth_openid/archive/#{node['apache']['mod_auth_openid']['ref']}.tar.gz"
-default['apache']['mod_auth_openid']['cache_dir'] = "/var/cache/mod_auth_openid"
+default['apache']['mod_auth_openid']['cache_dir'] = '/var/cache/mod_auth_openid'
default['apache']['mod_auth_openid']['dblocation'] = "#{node['apache']['mod_auth_openid']['cache_dir']}/mod_auth_openid.db"
case node['platform_family']
-when "freebsd"
+when 'freebsd'
default['apache']['mod_auth_openid']['configure_flags'] = [
- "CPPFLAGS=-I/usr/local/include",
- "LDFLAGS=-I/usr/local/lib -lsqlite3"
+ 'CPPFLAGS=-I/usr/local/include',
+ 'LDFLAGS=-I/usr/local/lib -lsqlite3'
]
else
default['apache']['mod_auth_openid']['configure_flags'] = []
View
9 attributes/mod_fastcgi.rb
@@ -1,13 +1,14 @@
#
-# Author:: Ameir Abdeldayem <ameir@ameir.net>
-# Copyright:: Copyright (c) 2013, Opscode, Inc.
-# License:: Apache License, Version 2.0
+# Cookbook Name:: apache2
+# Attributes:: mod_fastcgi
+#
+# Copyright 2013, 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
+# 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,
View
9 attributes/mod_ssl.rb
@@ -1,13 +1,14 @@
#
-# Author:: Nathan L Smith <nlloyds@gmail.com>
-# Copyright:: Copyright (c) 2012, Opscode, Inc.
-# License:: Apache License, Version 2.0
+# Cookbook Name:: apache2
+# Attributes:: mod_ssl
+#
+# Copyright 2012-2013, 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
+# 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,
View
8 definitions/apache_conf.rb
@@ -2,7 +2,7 @@
# Cookbook Name:: apache2
# Definition:: apache_conf
#
-# Copyright 2008-2009, Opscode, Inc.
+# Copyright 2008-20013, Opscode, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -19,8 +19,8 @@
define :apache_conf do
template "#{node['apache']['dir']}/mods-available/#{params[:name]}.conf" do
- source "mods/#{params[:name]}.conf.erb"
- notifies :restart, "service[apache2]"
- mode 0644
+ source "mods/#{params[:name]}.conf.erb"
+ mode '0644'
+ notifies :restart, 'service[apache2]'
end
end
View
34 definitions/apache_module.rb
@@ -2,7 +2,7 @@
# Cookbook Name:: apache2
# Definition:: apache_module
#
-# Copyright 2008-2009, Opscode, Inc.
+# Copyright 2008-2013, Opscode, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -18,36 +18,34 @@
#
define :apache_module, :enable => true, :conf => false do
- include_recipe "apache2"
+ include_recipe 'apache2::default'
- params[:filename] = params[:filename] || "mod_#{params[:name]}.so"
+ params[:filename] = params[:filename] || "mod_#{params[:name]}.so"
params[:module_path] = params[:module_path] || "#{node['apache']['libexecdir']}/#{params[:filename]}"
- if params[:conf]
- apache_conf params[:name]
- end
+ apache_conf params[:name] if params[:conf]
- if platform_family?("rhel", "fedora", "arch", "suse", "freebsd")
+ if platform_family?('rhel', 'fedora', 'arch', 'suse', 'freebsd')
file "#{node['apache']['dir']}/mods-available/#{params[:name]}.load" do
content "LoadModule #{params[:name]}_module #{params[:module_path]}\n"
- mode 0644
+ mode '0644'
end
end
if params[:enable]
- execute "a2enmod #{params[:name]}" do
- command "/usr/sbin/a2enmod #{params[:name]}"
- notifies :restart, "service[apache2]"
- not_if do (::File.symlink?("#{node['apache']['dir']}/mods-enabled/#{params[:name]}.load") and
- ((::File.exists?("#{node['apache']['dir']}/mods-available/#{params[:name]}.conf"))?
- (::File.symlink?("#{node['apache']['dir']}/mods-enabled/#{params[:name]}.conf")):(true)))
- end
- end
+ # execute "a2enmod #{params[:name]}" do
+ # command "/usr/sbin/a2enmod #{params[:name]}"
+ # notifies :restart, 'service[apache2]'
+ # not_if do
+ # ::File.symlink?("#{node['apache']['dir']}/mods-enabled/#{params[:name]}.load") &&
+ # ::File.exists?("#{node['apache']['dir']}/mods-available/#{params[:name]}.conf") ? ::File.symlink?("#{node['apache']['dir']}/mods-enabled/#{params[:name]}.conf") : true
+ # end
+ # end
else
execute "a2dismod #{params[:name]}" do
command "/usr/sbin/a2dismod #{params[:name]}"
- notifies :restart, "service[apache2]"
- only_if do ::File.symlink?("#{node['apache']['dir']}/mods-enabled/#{params[:name]}.load") end
+ notifies :restart, 'service[apache2]'
+ only_if { ::File.symlink?("#{node['apache']['dir']}/mods-enabled/#{params[:name]}.load") }
end
end
end
View
14 definitions/apache_site.rb
@@ -2,7 +2,7 @@
# Cookbook Name:: apache2
# Definition:: apache_site
#
-# Copyright 2008-2009, Opscode, Inc.
+# Copyright 2008-2013, Opscode, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -18,24 +18,24 @@
#
define :apache_site, :enable => true do
- include_recipe "apache2"
+ include_recipe 'apache2::default'
if params[:enable]
execute "a2ensite #{params[:name]}" do
command "/usr/sbin/a2ensite #{params[:name]}"
- notifies :restart, resources(:service => "apache2")
+ notifies :restart, 'service[apache2]'
not_if do
- ::File.symlink?("#{node['apache']['dir']}/sites-enabled/#{params[:name]}") or
+ ::File.symlink?("#{node['apache']['dir']}/sites-enabled/#{params[:name]}") ||
::File.symlink?("#{node['apache']['dir']}/sites-enabled/000-#{params[:name]}")
end
- only_if do ::File.exists?("#{node['apache']['dir']}/sites-available/#{params[:name]}") end
+ only_if { ::File.exists?("#{node['apache']['dir']}/sites-available/#{params[:name]}") }
end
else
execute "a2dissite #{params[:name]}" do
command "/usr/sbin/a2dissite #{params[:name]}"
- notifies :restart, resources(:service => "apache2")
+ notifies :restart, 'service[apache2]'
only_if do
- ::File.symlink?("#{node['apache']['dir']}/sites-enabled/#{params[:name]}") or
+ ::File.symlink?("#{node['apache']['dir']}/sites-enabled/#{params[:name]}") ||
::File.symlink?("#{node['apache']['dir']}/sites-enabled/000-#{params[:name]}")
end
end
View
28 definitions/web_app.rb
@@ -2,7 +2,7 @@
# Cookbook Name:: apache2
# Definition:: web_app
#
-# Copyright 2008-2009, Opscode, Inc.
+# Copyright 2008-2013, Opscode, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -17,29 +17,27 @@
# limitations under the License.
#
-define :web_app, :template => "web_app.conf.erb", :enable => true do
+define :web_app, :template => 'web_app.conf.erb', :enable => true do
application_name = params[:name]
- include_recipe "apache2"
- include_recipe "apache2::mod_rewrite"
- include_recipe "apache2::mod_deflate"
- include_recipe "apache2::mod_headers"
+ include_recipe 'apache2::default'
+ include_recipe 'apache2::mod_rewrite'
+ include_recipe 'apache2::mod_deflate'
+ include_recipe 'apache2::mod_headers'
template "#{node['apache']['dir']}/sites-available/#{application_name}.conf" do
- source params[:template]
- owner "root"
- group node['apache']['root_group']
- mode 0644
- if params[:cookbook]
- cookbook params[:cookbook]
- end
+ source params[:template]
+ owner 'root'
+ group node['apache']['root_group']
+ mode '0644'
+ cookbook params[:cookbook] if params[:cookbook]
variables(
:application_name => application_name,
- :params => params
+ :params => params
)
if ::File.exists?("#{node['apache']['dir']}/sites-enabled/#{application_name}.conf")
- notifies :reload, resources(:service => "apache2"), :delayed
+ notifies :reload, 'service[apache2]'
end
end
View
2  files/default/apache2_module_conf_generate.pl
@@ -3,7 +3,7 @@
=begin
Generates Ubuntu style module.load files.
-
+
./apache2_module_conf_generate.pl /usr/lib64/httpd/modules /etc/httpd/mods-available
ARGV[0] is the apache modules directory, ARGV[1] is where you want 'em.
View
5 files/default/tests/minitest/default_test.rb
@@ -16,7 +16,7 @@
end
it 'creates the conf.d directory' do
- directory("#{node['apache']['dir']}/conf.d").must_exist.with(:mode, "755")
+ directory("#{node['apache']['dir']}/conf.d").must_exist.with(:mode, '755')
end
it 'creates the logs directory' do
@@ -53,7 +53,7 @@
file("#{node['apache']['dir']}/conf.d/security").must_match(/^ServerTokens #{node['apache']['servertokens']} *$/)
end
- it "enables default_modules" do
+ it 'enables default_modules' do
node['apache']['default_modules'].each do |a2mod|
apache_enabled_modules.must_include "#{a2mod}_module"
end
@@ -73,5 +73,4 @@
it { config.must_include "Include #{node['apache']['dir']}/conf.d/" }
it { apache_config_parses? }
end
-
end
View
6 files/default/tests/minitest/god_monitor_test.rb
@@ -17,15 +17,15 @@
require File.expand_path('../support/helpers', __FILE__)
-describe "apache2::god_monitor" do
+describe 'apache2::god_monitor' do
include Helpers::Apache
it 'starts god service to supervise apache2' do
- service("god").must_be_running
+ service('god').must_be_running
end
it 'creates the god service template for apache' do
- file("/etc/god/conf.d/apache2.god").must_exist
+ file('/etc/god/conf.d/apache2.god').must_exist
end
it 'starts an apache2 service that works like a regular service' do
View
6 files/default/tests/minitest/mod_apreq2_test.rb
@@ -4,12 +4,12 @@
include Helpers::Apache
it 'enables apreq_module' do
- apache_enabled_modules.must_include "apreq_module"
+ apache_enabled_modules.must_include 'apreq_module'
end
it 'symlinks the module on EL' do
- skip unless %w{rhel fedora}.include?(node['platform_family'])
- libdir = node['kernel']['machine'] == 'x86_64' ? "lib64" : "lib"
+ skip unless %w[rhel fedora].include?(node['platform_family'])
+ libdir = node['kernel']['machine'] == 'x86_64' ? 'lib64' : 'lib'
link(
"/usr/#{libdir}/httpd/modules/mod_apreq.so"
).must_exist.with(
View
7 files/default/tests/minitest/mod_auth_cas_test.rb
@@ -1,11 +1,10 @@
require File.expand_path('../support/helpers', __FILE__)
-describe "apache2::mod_auth_cas" do
+describe 'apache2::mod_auth_cas' do
include Helpers::Apache
it 'enables auth_cas_module' do
- skip if %w{rhel fedora}.include?(node['platform_family']) && node['platform_version'].to_f > 6.0
- apache_enabled_modules.must_include "auth_cas_module"
+ skip if %w[rhel fedora].include?(node['platform_family']) && node['platform_version'].to_f > 6.0
+ apache_enabled_modules.must_include 'auth_cas_module'
end
-
end
View
23 files/default/tests/minitest/mod_auth_openid_test.rb
@@ -4,34 +4,33 @@
describe 'apache2::mod_auth_openid' do
include Helpers::Apache
- it "installs the opekele library" do
+ it 'installs the opekele library' do
lib_dir = Pathname.new(node['apache']['lib_dir']).dirname.to_s
file("#{lib_dir}/libopkele.so").must_exist
end
- it "does not add the module to httpd.conf" do
+ it 'does not add the module to httpd.conf' do
conffile = case node['platform']
when 'debian', 'ubuntu'
- "apache2.conf"
- when "redhat", "centos", "scientific", "fedora", "arch", "amazon"
- "conf/httpd.conf"
- when "freebsd"
- "httpd.conf"
+ 'apache2.conf'
+ when 'redhat', 'centos', 'scientific', 'fedora', 'arch', 'amazon'
+ 'conf/httpd.conf'
+ when 'freebsd'
+ 'httpd.conf'
end
httpd_config = File.read(File.join(node['apache']['dir'], conffile))
refute_match /^LoadModule authopenid_module /, httpd_config
end
- it "creates a cache directory for the module" do
+ it 'creates a cache directory for the module' do
directory(node['apache']['mod_auth_openid']['cache_dir']).must_exist.with(:owner, node['apache']['user'])
end
- it "ensures the db file is writable by apache" do
- file(node['apache']['mod_auth_openid']['dblocation']).must_exist.with(:owner, node['apache']['user']).and(:mode, "644")
+ it 'ensures the db file is writable by apache' do
+ file(node['apache']['mod_auth_openid']['dblocation']).must_exist.with(:owner, node['apache']['user']).and(:mode, '644')
end
it 'enables authopenid_module' do
- apache_enabled_modules.must_include "authopenid_module"
+ apache_enabled_modules.must_include 'authopenid_module'
end
-
end
View
1  files/default/tests/minitest/mod_cgi_test.rb
@@ -9,5 +9,4 @@
apache_enabled_modules.include?('cgid_module')
)
end
-
end
View
5 files/default/tests/minitest/mod_dav_svn_test.rb
@@ -4,11 +4,10 @@
include Helpers::Apache
it 'enables dav_svn_module' do
- apache_enabled_modules.must_include "dav_svn_module"
+ apache_enabled_modules.must_include('dav_svn_module')
end
it 'enables dav_module' do
- apache_enabled_modules.must_include "dav_module"
+ apache_enabled_modules.must_include('dav_module')
end
-
end
View
5 files/default/tests/minitest/mod_fastcgi.rb
@@ -1,11 +1,10 @@
require File.expand_path('../support/helpers', __FILE__)
-describe "apache2::mod_fastcgi" do
+describe 'apache2::mod_fastcgi' do
include Helpers::Apache
it 'enables fastcgi_module' do
skip if %w{rhel fedora}.include?(node['platform_family'])
- apache_enabled_modules.must_include "fastcgi_module"
+ apache_enabled_modules.must_include 'fastcgi_module'
end
-
end
View
3  files/default/tests/minitest/mod_include_test.rb
@@ -4,12 +4,11 @@
include Helpers::Apache
it 'enables include_module' do
- apache_enabled_modules.must_include "include_module"
+ apache_enabled_modules.must_include 'include_module'
end
it 'drops off the include module configuration' do
assert_match(/AddType text\/html .shtml/, File.read("#{node['apache']['dir']}/mods-enabled/include.conf"))
assert_match(/AddOutputFilter INCLUDES .shtml/, File.read("#{node['apache']['dir']}/mods-enabled/include.conf"))
end
-
end
View
3  files/default/tests/minitest/mod_perl_test.rb
@@ -4,7 +4,7 @@
include Helpers::Apache
it 'enables perl_module' do
- apache_enabled_modules.must_include "perl_module"
+ apache_enabled_modules.must_include('perl_module')
end
it 'installs the apache request library' do
@@ -14,5 +14,4 @@
end
package(req_pkg).must_be_installed
end
-
end
View
4 files/default/tests/minitest/mod_php5_test.rb
@@ -4,10 +4,10 @@
include Helpers::Apache
it 'enables php5_module' do
- apache_enabled_modules.must_include "php5_module"
+ apache_enabled_modules.must_include('php5_module')
end
- it "deletes the packaged php config if any" do
+ it 'deletes the packaged php config if any' do
file("#{node['apache']['dir']}/conf.d/php.conf").wont_exist
end
end
View
3  files/default/tests/minitest/mod_python_test.rb
@@ -4,7 +4,6 @@
include Helpers::Apache
it 'enables python_module' do
- apache_enabled_modules.must_include "python_module"
+ apache_enabled_modules.must_include('python_module')
end
-
end
View
9 files/default/tests/minitest/mod_ssl_test.rb
@@ -4,19 +4,19 @@
include Helpers::Apache
it 'installs the mod_ssl package on RHEL distributions' do
- skip unless ["rhel", "fedora"].include? node['platform_family']
- package("mod_ssl").must_be_installed
+ skip unless %w[rhel fedora].include?(node['platform_family'])
+ package('mod_ssl').must_be_installed
end
it 'enables ssl_module' do
- apache_enabled_modules.must_include "ssl_module"
+ apache_enabled_modules.must_include 'ssl_module'
end
it 'does not store SSL config in conf.d' do
file("#{node['apache']['dir']}/conf.d/ssl.conf").wont_exist
end
- it "is configured to listen on port 443" do
+ it 'is configured to listen on port 443' do
apache_configured_ports.must_include(443)
end
@@ -24,5 +24,4 @@
assert_match(/^SSLCipherSuite #{node['apache']['mod_ssl']['cipher_suite']}$/,
File.read("#{node['apache']['dir']}/mods-enabled/ssl.conf"))
end
-
end
View
19 files/default/tests/minitest/support/helpers.rb
@@ -1,4 +1,5 @@
module Helpers
+ # MiniTest helpers
module Apache
require 'chef/mixin/shell_out'
include Chef::Mixin::ShellOut
@@ -30,9 +31,9 @@ def apache_enabled_modules
def apache_service
service(
case node['platform']
- when "debian", "ubuntu" then "apache2"
- when "freebsd" then "apache22"
- else "httpd"
+ when 'debian', 'ubuntu' then 'apache2'
+ when 'freebsd' then 'apache22'
+ else 'httpd'
end
)
end
@@ -40,23 +41,23 @@ def apache_service
def config
file(
case node['platform']
- when "debian", "ubuntu" then "#{node['apache']['dir']}/apache2.conf"
- when "freebsd" then "#{node['apache']['dir']}/httpd.conf"
+ when 'debian', 'ubuntu' then "#{node['apache']['dir']}/apache2.conf"
+ when 'freebsd' then "#{node['apache']['dir']}/httpd.conf"
else "#{node['apache']['dir']}/conf/httpd.conf"
end
)
end
def ran_recipe?(recipe)
- if Chef::VERSION < "11.0"
+ if Chef::VERSION < '11.0'
seen_recipes = node.run_state[:seen_recipes]
recipes = seen_recipes.keys.each { |i| i }
else
recipes = run_context.loaded_recipes
end
- if recipes.empty? and Chef::Config[:solo]
- #If you have roles listed in your run list they are NOT expanded
- recipes = node.run_list.map {|item| item.name if item.type == :recipe }
+ if recipes.empty? && Chef::Config[:solo]
+ # If you have roles listed in your run list they are NOT expanded
+ recipes = node.run_list.map { |item| item.name if item.type == :recipe }
end
recipes.include?(recipe)
end
View
442 metadata.rb
@@ -1,219 +1,225 @@
-name "apache2"
-maintainer "Opscode, Inc."
-maintainer_email "cookbooks@opscode.com"
-license "Apache 2.0"
-description "Installs and configures all aspects of apache2 using Debian style symlinks with helper definitions"
+name 'apache2'
+maintainer 'Opscode, Inc.'
+maintainer_email 'cookbooks@opscode.com'
+license 'Apache 2.0'
+description 'Installs and configures all aspects of apache2 using Debian style symlinks with helper definitions'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
-version "1.7.0"
-recipe "apache2", "Main Apache configuration"
-recipe "apache2::logrotate", "Rotate apache2 logs. Requires logrotate cookbook"
-recipe "apache2::mod_alias", "Apache module 'alias' with config file"
-recipe "apache2::mod_apreq2", "Apache module 'apreq'"
-recipe "apache2::mod_auth_basic", "Apache module 'auth_basic'"
-recipe "apache2::mod_auth_digest", "Apache module 'auth_digest'"
-recipe "apache2::mod_auth_openid", "Apache module 'authopenid'"
-recipe "apache2::mod_authn_file", "Apache module 'authn_file'"
-recipe "apache2::mod_authnz_ldap", "Apache module 'authnz_ldap'"
-recipe "apache2::mod_authz_default", "Apache module 'authz_default'"
-recipe "apache2::mod_authz_groupfile", "Apache module 'authz_groupfile'"
-recipe "apache2::mod_authz_host", "Apache module 'authz_host'"
-recipe "apache2::mod_authz_user", "Apache module 'authz_user'"
-recipe "apache2::mod_autoindex", "Apache module 'autoindex' with config file"
-recipe "apache2::mod_cgi", "Apache module 'cgi'"
-recipe "apache2::mod_dav", "Apache module 'dav'"
-recipe "apache2::mod_dav_svn", "Apache module 'dav_svn'"
-recipe "apache2::mod_deflate", "Apache module 'deflate' with config file"
-recipe "apache2::mod_dir", "Apache module 'dir' with config file"
-recipe "apache2::mod_env", "Apache module 'env'"
-recipe "apache2::mod_expires", "Apache module 'expires'"
-recipe "apache2::mod_fcgid", "Apache module 'fcgid', package on ubuntu/debian, rhel/centos, compile source on suse; with config file"
-recipe "apache2::mod_headers", "Apache module 'headers'"
-recipe "apache2::mod_include", "Apache module 'include'"
-recipe "apache2::mod_ldap", "Apache module 'ldap'"
-recipe "apache2::mod_log_config", "Apache module 'log_config'"
-recipe "apache2::mod_mime", "Apache module 'mime' with config file"
-recipe "apache2::mod_negotiation", "Apache module 'negotiation' with config file"
-recipe "apache2::mod_perl", "Apache module 'perl'"
-recipe "apache2::mod_php5", "Apache module 'php5'"
-recipe "apache2::mod_proxy", "Apache module 'proxy' with config file"
-recipe "apache2::mod_proxy_ajp", "Apache module 'proxy_ajp'"
-recipe "apache2::mod_proxy_balancer", "Apache module 'proxy_balancer'"
-recipe "apache2::mod_proxy_connect", "Apache module 'proxy_connect'"
-recipe "apache2::mod_proxy_http", "Apache module 'proxy_http'"
-recipe "apache2::mod_python", "Apache module 'python'"
-recipe "apache2::mod_rewrite", "Apache module 'rewrite'"
-recipe "apache2::mod_setenvif", "Apache module 'setenvif' with config file"
-recipe "apache2::mod_ssl", "Apache module 'ssl' with config file, adds port 443 to listen_ports"
-recipe "apache2::mod_status", "Apache module 'status' with config file"
-recipe "apache2::mod_xsendfile", "Apache module 'xsendfile'"
-
-%w{redhat centos scientific fedora debian ubuntu arch freebsd amazon}.each do |os|
- supports os
-end
-
-attribute "apache",
- :display_name => "Apache Hash",
- :description => "Hash of Apache attributes",
- :type => "hash"
-
-attribute "apache/dir",
- :display_name => "Apache Directory",
- :description => "Location for Apache configuration",
- :default => "/etc/apache2"
-
-attribute "apache/log_dir",
- :display_name => "Apache Log Directory",
- :description => "Location for Apache logs",
- :default => "/etc/apache2"
-
-attribute "apache/user",
- :display_name => "Apache User",
- :description => "User Apache runs as",
- :default => "www-data"
-
-attribute "apache/binary",
- :display_name => "Apache Binary",
- :description => "Apache server daemon program",
- :default => "/usr/sbin/apache2"
-
-attribute "apache/icondir",
- :display_name => "Apache Icondir",
- :description => "Directory location for icons",
- :default => "/usr/share/apache2/icons"
-
-attribute "apache/listen_addresses",
- :display_name => "Apache Listen Addresses",
- :description => "Addresses that Apache should listen on",
- :type => "array",
- :default => ["*"]
-
-attribute "apache/listen_ports",
- :display_name => "Apache Listen Ports",
- :description => "Ports that Apache should listen on",
- :type => "array",
- :default => ["80", "443"]
-
-attribute "apache/contact",
- :display_name => "Apache Contact",
- :description => "Email address of webmaster",
- :default => "ops@example.com"
-
-attribute "apache/timeout",
- :display_name => "Apache Timeout",
- :description => "Connection timeout value",
- :default => "300"
-
-attribute "apache/keepalive",
- :display_name => "Apache Keepalive",
- :description => "HTTP persistent connections",
- :default => "On"
-
-attribute "apache/keepaliverequests",
- :display_name => "Apache Keepalive Requests",
- :description => "Number of requests allowed on a persistent connection",
- :default => "100"
-
-attribute "apache/keepalivetimeout",
- :display_name => "Apache Keepalive Timeout",
- :description => "Time to wait for requests on persistent connection",
- :default => "5"
-
-attribute "apache/servertokens",
- :display_name => "Apache Server Tokens",
- :description => "Server response header",
- :default => "Prod"
-
-attribute "apache/serversignature",
- :display_name => "Apache Server Signature",
- :description => "Configure footer on server-generated documents",
- :default => "On"
-
-attribute "apache/traceenable",
- :display_name => "Apache Trace Enable",
- :description => "Determine behavior of TRACE requests",
- :default => "On"
-
-attribute "apache/allowed_openids",
- :display_name => "Apache Allowed OpenIDs",
- :description => "Array of OpenIDs allowed to authenticate",
- :default => ""
-
-attribute "apache/prefork",
- :display_name => "Apache Prefork",
- :description => "Hash of Apache prefork tuning attributes.",
- :type => "hash"
-
-attribute "apache/prefork/startservers",
- :display_name => "Apache Prefork MPM StartServers",
- :description => "Number of MPM servers to start",
- :default => "16"
-
-attribute "apache/prefork/minspareservers",
- :display_name => "Apache Prefork MPM MinSpareServers",
- :description => "Minimum number of spare server processes",
- :default => "16"
-
-attribute "apache/prefork/maxspareservers",
- :display_name => "Apache Prefork MPM MaxSpareServers",
- :description => "Maximum number of spare server processes",
- :default => "32"
-
-attribute "apache/prefork/serverlimit",
- :display_name => "Apache Prefork MPM ServerLimit",
- :description => "Upper limit on configurable server processes",
- :default => "400"
-
-attribute "apache/prefork/maxclients",
- :display_name => "Apache Prefork MPM MaxClients",
- :description => "Maximum number of simultaneous connections",
- :default => "400"
-
-attribute "apache/prefork/maxrequestsperchild",
- :display_name => "Apache Prefork MPM MaxRequestsPerChild",
- :description => "Maximum number of request a child process will handle",
- :default => "10000"
-
-attribute "apache/worker",
- :display_name => "Apache Worker",
- :description => "Hash of Apache prefork tuning attributes.",
- :type => "hash"
-
-attribute "apache/worker/startservers",
- :display_name => "Apache Worker MPM StartServers",
- :description => "Initial number of server processes to start",
- :default => "4"
-
-attribute "apache/worker/maxclients",
- :display_name => "Apache Worker MPM MaxClients",
- :description => "Maximum number of simultaneous connections",
- :default => "1024"
-
-attribute "apache/worker/minsparethreads",
- :display_name => "Apache Worker MPM MinSpareThreads",
- :description => "Minimum number of spare worker threads",
- :default => "64"
-
-attribute "apache/worker/maxsparethreads",
- :display_name => "Apache Worker MPM MaxSpareThreads",
- :description => "Maximum number of spare worker threads",
- :default => "192"
-
-attribute "apache/worker/threadsperchild",
- :display_name => "Apache Worker MPM ThreadsPerChild",
- :description => "Constant number of worker threads in each server process",
- :default => "64"
-
-attribute "apache/worker/maxrequestsperchild",
- :display_name => "Apache Worker MPM MaxRequestsPerChild",
- :description => "Maximum number of request a child process will handle",
- :default => "0"
-
-attribute "apache/default_modules",
- :display_name => "Apache Default Modules",
- :description => "Default modules to enable via recipes",
- :default => "status alias auth_basic authn_file authz_default authz_groupfile authz_host authz_user autoindex dir env mime negotiation setenvif"
-
-attribute "apache/mod_ssl/cipher_suite",
- :display_name => "Apache mod_ssl Cipher Suite",
- :description => "String of SSL ciphers to use for SSLCipherSuite",
- :default => "RC4-SHA:HIGH:!ADH"
+version '1.7.0'
+recipe 'apache2', 'Main Apache configuration'
+recipe 'apache2::logrotate', 'Rotate apache2 logs. Requires logrotate cookbook'
+recipe 'apache2::mod_alias', 'Apache module "alias" with config file'
+recipe 'apache2::mod_apreq2', 'Apache module "apreq"'
+recipe 'apache2::mod_auth_basic', 'Apache module "auth_basic"'
+recipe 'apache2::mod_auth_digest', 'Apache module "auth_digest"'
+recipe 'apache2::mod_auth_openid', 'Apache module "authopenid"'
+recipe 'apache2::mod_authn_file', 'Apache module "authn_file"'
+recipe 'apache2::mod_authnz_ldap', 'Apache module "authnz_ldap"'
+recipe 'apache2::mod_authz_default', 'Apache module "authz_default"'
+recipe 'apache2::mod_authz_groupfile', 'Apache module "authz_groupfile"'
+recipe 'apache2::mod_authz_host', 'Apache module "authz_host"'
+recipe 'apache2::mod_authz_user', 'Apache module "authz_user"'
+recipe 'apache2::mod_autoindex', 'Apache module "autoindex" with config file'
+recipe 'apache2::mod_cgi', 'Apache module "cgi"'
+recipe 'apache2::mod_dav', 'Apache module "dav"'
+recipe 'apache2::mod_dav_svn', 'Apache module "dav_svn"'
+recipe 'apache2::mod_deflate', 'Apache module "deflate" with config file'
+recipe 'apache2::mod_dir', 'Apache module "dir" with config file'
+recipe 'apache2::mod_env', 'Apache module "env"'
+recipe 'apache2::mod_expires', 'Apache module "expires"'
+recipe 'apache2::mod_fcgid', 'Apache module "fcgid", package on ubuntu/debian, rhel/centos, compile source on suse; with config file'
+recipe 'apache2::mod_headers', 'Apache module "headers"'
+recipe 'apache2::mod_include', 'Apache module "include"'
+recipe 'apache2::mod_ldap', 'Apache module "ldap"'
+recipe 'apache2::mod_log_config', 'Apache module "log_config"'
+recipe 'apache2::mod_mime', 'Apache module "mime" with config file'
+recipe 'apache2::mod_negotiation', 'Apache module "negotiation" with config file'
+recipe 'apache2::mod_perl', 'Apache module "perl"'
+recipe 'apache2::mod_php5', 'Apache module "php5"'
+recipe 'apache2::mod_proxy', 'Apache module "proxy" with config file'
+recipe 'apache2::mod_proxy_ajp', 'Apache module "proxy_ajp"'
+recipe 'apache2::mod_proxy_balancer', 'Apache module "proxy_balancer"'
+recipe 'apache2::mod_proxy_connect', 'Apache module "proxy_connect"'
+recipe 'apache2::mod_proxy_http', 'Apache module "proxy_http"'
+recipe 'apache2::mod_python', 'Apache module "python"'
+recipe 'apache2::mod_rewrite', 'Apache module "rewrite"'
+recipe 'apache2::mod_setenvif', 'Apache module "setenvif" with config file'
+recipe 'apache2::mod_ssl', 'Apache module "ssl" with config file, adds port 443 to listen_ports'
+recipe 'apache2::mod_status', 'Apache module "status" with config file'
+recipe 'apache2::mod_xsendfile', 'Apache module "xsendfile"'
+
+supports 'amazon'
+supports 'arch'
+supports 'centos'
+supports 'debian'
+supports 'fedora'
+supports 'freebsd'
+supports 'redhat'
+supports 'scientific'
+supports 'ubuntu'
+
+attribute 'apache',
+ :display_name => 'Apache Hash',
+ :description => 'Hash of Apache attributes',
+ :type => 'hash'
+
+attribute 'apache/dir',
+ :display_name => 'Apache Directory',
+ :description => 'Location for Apache configuration',
+ :default => '/etc/apache2'
+
+attribute 'apache/log_dir',
+ :display_name => 'Apache Log Directory',
+ :description => 'Location for Apache logs',
+ :default => '/etc/apache2'
+
+attribute 'apache/user',
+ :display_name => 'Apache User',
+ :description => 'User Apache runs as',
+ :default => 'www-data'
+
+attribute 'apache/binary',
+ :display_name => 'Apache Binary',
+ :description => 'Apache server daemon program',
+ :default => '/usr/sbin/apache2'
+
+attribute 'apache/icondir',
+ :display_name => 'Apache Icondir',
+ :description => 'Directory location for icons',
+ :default => '/usr/share/apache2/icons'
+
+attribute 'apache/listen_addresses',
+ :display_name => 'Apache Listen Addresses',
+ :description => 'Addresses that Apache should listen on',
+ :type => 'array',
+ :default => %w[*]
+
+attribute 'apache/listen_ports',
+ :display_name => 'Apache Listen Ports',
+ :description => 'Ports that Apache should listen on',
+ :type => 'array',
+ :default => %w[80 443]
+
+attribute 'apache/contact',
+ :display_name => 'Apache Contact',
+ :description => 'Email address of webmaster',
+ :default => 'ops@example.com'
+
+attribute 'apache/timeout',
+ :display_name => 'Apache Timeout',
+ :description => 'Connection timeout value',
+ :default => '300'
+
+attribute 'apache/keepalive',
+ :display_name => 'Apache Keepalive',
+ :description => 'HTTP persistent connections',
+ :default => 'On'
+
+attribute 'apache/keepaliverequests',
+ :display_name => 'Apache Keepalive Requests',
+ :description => 'Number of requests allowed on a persistent connection',
+ :default => '100'
+
+attribute 'apache/keepalivetimeout',
+ :display_name => 'Apache Keepalive Timeout',
+ :description => 'Time to wait for requests on persistent connection',
+ :default => '5'
+
+attribute 'apache/servertokens',
+ :display_name => 'Apache Server Tokens',
+ :description => 'Server response header',
+ :default => 'Prod'
+
+attribute 'apache/serversignature',
+ :display_name => 'Apache Server Signature',
+ :description => 'Configure footer on server-generated documents',
+ :default => 'On'
+
+attribute 'apache/traceenable',
+ :display_name => 'Apache Trace Enable',
+ :description => 'Determine behavior of TRACE requests',
+ :default => 'On'
+
+attribute 'apache/allowed_openids',
+ :display_name => 'Apache Allowed OpenIDs',
+ :description => 'Array of OpenIDs allowed to authenticate',
+ :default => ''
+
+attribute 'apache/prefork',
+ :display_name => 'Apache Prefork',
+ :description => 'Hash of Apache prefork tuning attributes.',
+ :type => 'hash'
+
+attribute 'apache/prefork/startservers',
+ :display_name => 'Apache Prefork MPM StartServers',
+ :description => 'Number of MPM servers to start',
+ :default => '16'
+
+attribute 'apache/prefork/minspareservers',
+ :display_name => 'Apache Prefork MPM MinSpareServers',
+ :description => 'Minimum number of spare server processes',
+ :default => '16'
+
+attribute 'apache/prefork/maxspareservers',
+ :display_name => 'Apache Prefork MPM MaxSpareServers',
+ :description => 'Maximum number of spare server processes',
+ :default => '32'
+
+attribute 'apache/prefork/serverlimit',
+ :display_name => 'Apache Prefork MPM ServerLimit',
+ :description => 'Upper limit on configurable server processes',
+ :default => '400'
+
+attribute 'apache/prefork/maxclients',
+ :display_name => 'Apache Prefork MPM MaxClients',
+ :description => 'Maximum number of simultaneous connections',
+ :default => '400'
+
+attribute 'apache/prefork/maxrequestsperchild',
+ :display_name => 'Apache Prefork MPM MaxRequestsPerChild',
+ :description => 'Maximum number of request a child process will handle',
+ :default => '10000'
+
+attribute 'apache/worker',
+ :display_name => 'Apache Worker',
+ :description => 'Hash of Apache prefork tuning attributes.',
+ :type => 'hash'
+
+attribute 'apache/worker/startservers',
+ :display_name => 'Apache Worker MPM StartServers',
+ :description => 'Initial number of server processes to start',
+ :default => '4'
+
+attribute 'apache/worker/maxclients',
+ :display_name => 'Apache Worker MPM MaxClients',
+ :description => 'Maximum number of simultaneous connections',
+ :default => '1024'
+
+attribute 'apache/worker/minsparethreads',
+ :display_name => 'Apache Worker MPM MinSpareThreads',
+ :description => 'Minimum number of spare worker threads',
+ :default => '64