Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

release v1.2.0

  • Loading branch information...
commit e0b369047953c41ec4a0a43d2533795047309abb 1 parent 0de251d
@jtimberman jtimberman authored
Showing with 511 additions and 109 deletions.
  1. +6 −0 CHANGELOG.md
  2. +0 −29 CONTRIBUTING
  3. +257 −0 CONTRIBUTING.md
  4. +247 −79 README.md
  5. +1 −1  metadata.rb
View
6 CHANGELOG.md
@@ -1,3 +1,9 @@
+## 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
View
29 CONTRIBUTING
@@ -1,29 +0,0 @@
-If you would like to contribute, please open a ticket in JIRA:
-
-* http://tickets.opscode.com
-
-Create the ticket in the COOK project and use the cookbook name as the
-component.
-
-For all code contributions, we ask that contributors sign a
-contributor license agreement (CLA). Instructions may be found here:
-
-* http://wiki.opscode.com/display/chef/How+to+Contribute
-
-When contributing changes to individual cookbooks, please do not
-modify the version number in the metadata.rb. Also please do not
-update the CHANGELOG.md for a new version. Not all changes to a
-cookbook may be merged and released in the same versions. Opscode will
-handle the version updates during the release process. You are welcome
-to correct typos or otherwise make updates to documentation in the
-README.
-
-If a contribution adds new platforms or platform versions, indicate
-such in the body of the commit message(s), and update the relevant
-COOK ticket. When writing commit messages, it is helpful for others if
-you indicate the COOK ticket. For example:
-
- git commit -m '[COOK-1041] Updated pool resource to correctly delete.'
-
-In the ticket itself, it is also helpful if you include log output of
-a successful Chef run, but this is not absolutely required.
View
257 CONTRIBUTING.md
@@ -0,0 +1,257 @@
+# Contributing to Opscode Cookbooks
+
+We are glad you want to contribute to Opscode Cookbooks! The first
+step is the desire to improve the project.
+
+You can find the answers to additional frequently asked questions
+[on the wiki](http://wiki.opscode.com/display/chef/How+to+Contribute).
+
+You can find additional information about
+[contributing to cookbooks](http://wiki.opscode.com/display/chef/How+to+Contribute+to+Opscode+Cookbooks)
+on the wiki as well.
+
+## Quick-contribute
+
+* Create an account on our [bug tracker](http://tickets.opscode.com)
+* Sign our contributor agreement (CLA)
+[ online](https://secure.echosign.com/public/hostedForm?formid=PJIF5694K6L)
+(keep reading if you're contributing on behalf of your employer)
+* Create a ticket for your change on the
+ [bug tracker](http://tickets.opscode.com)
+* Link to your patch as a rebased git branch or pull request from the
+ ticket
+* Resolve the ticket as fixed
+
+We regularly review contributions and will get back to you if we have
+any suggestions or concerns.
+
+## The Apache License and the CLA/CCLA
+
+Licensing is very important to open source projects, it helps ensure
+the software continues to be available under the terms that the author
+desired. Chef uses the Apache 2.0 license to strike a balance between
+open contribution and allowing you to use the software however you
+would like to.
+
+The license tells you what rights you have that are provided by the
+copyright holder. It is important that the contributor fully
+understands what rights they are licensing and agrees to them.
+Sometimes the copyright holder isn't the contributor, most often when
+the contributor is doing work for a company.
+
+To make a good faith effort to ensure these criteria are met, Opscode
+requires a Contributor License Agreement (CLA) or a Corporate
+Contributor License Agreement (CCLA) for all contributions. This is
+without exception due to some matters not being related to copyright
+and to avoid having to continually check with our lawyers about small
+patches.
+
+It only takes a few minutes to complete a CLA, and you retain the
+copyright to your contribution.
+
+You can complete our contributor agreement (CLA)
+[ online](https://secure.echosign.com/public/hostedForm?formid=PJIF5694K6L).
+If you're contributing on behalf of your employer, have your employer
+fill out our
+[Corporate CLA](https://secure.echosign.com/public/hostedForm?formid=PIE6C7AX856)
+instead.
+
+## Ticket Tracker (JIRA)
+
+The [ticket tracker](http://tickets.opscode.com) is the most important
+documentation for the code base. It provides significant historical
+information, such as:
+
+* Which release a bug fix is included in
+* Discussion regarding the design and merits of features
+* Error output to aid in finding similar bugs
+
+Each ticket should aim to fix one bug or add one feature.
+
+## Using git
+
+You can get a quick copy of the repository for this cookbook by
+running `git clone
+git://github.com/opscode-coobkooks/COOKBOOKNAME.git`.
+
+For collaboration purposes, it is best if you create a Github account
+and fork the repository to your own account. Once you do this you will
+be able to push your changes to your Github repository for others to
+see and use.
+
+If you have another repository in your GitHub account named the same
+as the cookbook, we suggest you suffix the repository with -cookbook.
+
+### Branches and Commits
+
+You should submit your patch as a git branch named after the ticket,
+such as COOK-1337. This is called a _topic branch_ and allows users to
+associate a branch of code with the ticket.
+
+It is a best practice to have your commit message have a _summary
+line_ that includes the ticket number, followed by an empty line and
+then a brief description of the commit. This also helps other
+contributors understand the purpose of changes to the code.
+
+ [COOK-1757] - platform_family and style
+
+ * use platform_family for platform checking
+ * update notifies syntax to "resource_type[resource_name]" instead of
+ resources() lookup
+ * COOK-692 - delete config files dropped off by packages in conf.d
+ * dropped debian 4 support because all other platforms have the same
+ values, and it is older than "old stable" debian release
+
+Remember that not all users use Chef in the same way or on the same
+operating systems as you, so it is helpful to be clear about your use
+case and change so they can understand it even when it doesn't apply
+to them.
+
+### Github and Pull Requests
+
+All of Opscode's open source cookbook projects are available on
+[Github](http://www.github.com/opscode-cookbooks).
+
+We don't require you to use Github, and we will even take patch diffs
+attached to tickets on the tracker. However Github has a lot of
+convenient features, such as being able to see a diff of changes
+between a pull request and the main repository quickly without
+downloading the branch.
+
+If you do choose to use a pull request, please provide a link to the
+pull request from the ticket __and__ a link to the ticket from the
+pull request. Because pull requests only have two states, open and
+closed, we can't easily filter pull requests that are waiting for a
+reply from the author for various reasons.
+
+### More information
+
+Additional help with git is available on the
+[Working with Git](http://wiki.opscode.com/display/chef/Working+with+Git)
+wiki page.
+
+## Functional and Unit Tests
+
+This cookbook is set up to run tests under
+[Opscode's test-kitchen](https://github.com/opscode/test-kitchen). It
+uses minitest-chef to run integration tests after the node has been
+converged to verify that the state of the node.
+
+Test kitchen should run completely without exception using the default
+[baseboxes provided by Opscode](https://github.com/opscode/bento).
+Because Test Kitchen creates VirtualBox machines and runs through
+every configuration in the Kitchenfile, it may take some time for
+these tests to complete.
+
+If your changes are only for a specific recipe, run only its
+configuration with Test Kitchen. If you are adding a new recipe, or
+other functionality such as a LWRP or definition, please add
+appropriate tests and ensure they run with Test Kitchen.
+
+If any don't pass, investigate them before submitting your patch.
+
+Any new feature should have unit tests included with the patch with
+good code coverage to help protect it from future changes. Similarly,
+patches that fix a bug or regression should have a _regression test_.
+Simply put, this is a test that would fail without your patch but
+passes with it. The goal is to ensure this bug doesn't regress in the
+future. Consider a regular expression that doesn't match a certain
+pattern that it should, so you provide a patch and a test to ensure
+that the part of the code that uses this regular expression works as
+expected. Later another contributor may modify this regular expression
+in a way that breaks your use cases. The test you wrote will fail,
+signalling to them to research your ticket and use case and accounting
+for it.
+
+If you need help writing tests, please ask on the Chef Developer's
+mailing list, or the #chef-hacking IRC channel.
+
+## Code Review
+
+Opscode regularly reviews code contributions and provides suggestions
+for improvement in the code itself or the implementation.
+
+We find contributions by searching the ticket tracker for _resolved_
+tickets with a status of _fixed_. If we have feedback we will reopen
+the ticket and you should resolve it again when you've made the
+changes or have a response to our feedback. When we believe the patch
+is ready to be merged, we will tag the _Code Reviewed_ field with
+_Reviewed_.
+
+Depending on the project, these tickets are then merged within a week
+or two, depending on the current release cycle.
+
+## Release Cycle
+
+The versioning for Opscode Cookbook projects is X.Y.Z.
+
+* X is a major release, which may not be fully compatible with prior
+ major releases
+* Y is a minor release, which adds both new features and bug fixes
+* Z is a patch release, which adds just bug fixes
+
+A released version of a cookbook will end in an even number, e.g.
+"1.2.4" or "0.8.0". When development for the next version of the
+cookbook begins, the "Z" patch number is incremented to the next odd
+number, however the next release of the cookbook may be a major or
+minor incrementing version.
+
+Releases of Opscode's cookbooks are usually announced on the Chef user
+mailing list. Releases of several cookbooks may be batched together
+and announced on the [Opscode Blog](http://www.opscode.com/blog).
+
+## Working with the community
+
+These resources will help you learn more about Chef and connect to
+other members of the Chef community:
+
+* [chef](http://lists.opscode.com/sympa/info/chef) and
+ [chef-dev](http://lists.opscode.com/sympa/info/chef-dev) mailing
+ lists
+* #chef and #chef-hacking IRC channels on irc.freenode.net
+* [Community Cookbook site](http://community.opscode.com)
+* [Chef wiki](http://wiki.opscode.com/display/chef)
+* Opscode Chef [product page](http://www.opscode.com/chef)
+
+
+## Cookbook Contribution Do's and Don't's
+
+Please do include tests for your contribution. If you need help, ask
+on the
+[chef-dev mailing list](http://lists.opscode.com/sympa/info/chef-dev)
+or the
+[#chef-hacking IRC channel](http://community.opscode.com/chat/chef-hacking).
+Not all platforms that a cookbook supports may be supported by Test
+Kitchen. Please provide evidence of testing your contribution if it
+isn't trivial so we don't have to duplicate effort in testing. Chef
+10.14+ "doc" formatted output is sufficient.
+
+Please do indicate new platform (families) or platform versions in the
+commit message, and update the relevant ticket.
+
+If a contribution adds new platforms or platform versions, indicate
+such in the body of the commit message(s), and update the relevant
+COOK ticket. When writing commit messages, it is helpful for others if
+you indicate the COOK ticket. For example:
+
+ git commit -m '[COOK-1041] - Updated pool resource to correctly
+ delete.'
+
+Please do use [foodcritic](http://acrmp.github.com/foodcritic) to
+lint-check the cookbook. Except FC007, it should pass all correctness
+rules. FC007 is okay as long as the dependent cookbooks are *required*
+for the default behavior of the cookbook, such as to support an
+uncommon platform, secondary recipe, etc.
+
+Please do ensure that your changes do not break or modify behavior for
+other platforms supported by the cookbook. For example if your changes
+are for Debian, make sure that they do not break on CentOS.
+
+Please do not modify the version number in the metadata.rb, Opscode
+will select the appropriate version based on the release cycle
+information above.
+
+Please do not update the CHANGELOG.md for a new version. Not all
+changes to a cookbook may be merged and released in the same versions.
+Opscode will update the CHANGELOG.md when releasing a new version of
+the cookbook.
View
326 README.md
@@ -1,73 +1,154 @@
Description
===========
-This cookbook provides a complete Debian/Ubuntu style Apache HTTPD configuration. Non-Debian based distributions such as Red Hat/CentOS, ArchLinux and others supported by this cookbook will have a configuration that mimics Debian/Ubuntu style as it is easier to manage with Chef.
+This cookbook provides a complete Debian/Ubuntu style Apache HTTPD
+configuration. Non-Debian based distributions such as Red Hat/CentOS,
+ArchLinux and others supported by this cookbook will have a
+configuration that mimics Debian/Ubuntu style as it is easier to
+manage with Chef.
-Debian-style Apache configuration uses scripts to manage modules and sites (vhosts). The scripts are:
+Debian-style Apache configuration uses scripts to manage modules and
+sites (vhosts). The scripts are:
* a2ensite
* a2dissite
* a2enmod
* a2dismod
-This cookbook ships with templates of these scripts for non Debian/Ubuntu platforms. The scripts are used in the __Definitions__ below.
+This cookbook ships with templates of these scripts for non
+Debian/Ubuntu platforms. The scripts are used in the __Definitions__
+below.
Requirements
============
+## Ohai and Chef:
+
+* Ohai: 0.6.12+
+* Chef: 0.10.10+
+
+As of v1.2.0, this cookbook makes use of `node['platform_family']` to
+simplify platform selection logic. This attribute was introduced in
+Ohai v0.6.12. The recipe methods were introduced in Chef v0.10.10. If
+you must run an older version of Chef or Ohai, use [version 1.1.16 of
+this cookbook](http://community.opscode.com/cookbooks/apache2/versions/1_1_16/downloads).
+
## Cookbooks:
-This cookbook doesn't have direct dependencies on other cookbooks. Depending on your OS configuration and security policy, you may need additional recipes or cookbooks for this cookbook's recipes to converge on the node. In particular, the following Operating System nuances may affect the behavior:
+This cookbook doesn't have direct dependencies on other cookbooks, as
+none are needed for the default recipe or the general use cases.
+
+Depending on your OS configuration and security policy, you may need
+additional recipes or cookbooks for this cookbook's recipes to
+converge on the node. In particular, the following Operating System
+settings may affect the behavior of this cookbook:
* apt cache outdated
* SELinux enabled
* IPtables
* Compile tools
+* 3rd party repositories
+
+On Ubuntu/Debian, use Opscode's `apt` cookbook to ensure the package
+cache is updated so Chef can install packages, or consider putting
+apt-get in your bootstrap process or
+[knife bootstrap template](http://wiki.opscode.com/display/chef/Knife+Bootstrap).
+
+On RHEL, SELinux is enabled by default. The `selinux` cookbook
+contains a `permissive` recipe that can be used to set SELinux to
+"Permissive" state. Otherwise, additional recipes need to be created
+by the user to address SELinux permissions.
+
+The easiest but **certainly not ideal way** to deal with IPtables is
+to flush all rules. Opscode does provide an `iptables` cookbook but is
+migrating from the approach used there to a more robust solution
+utilizing a general "firewall" LWRP that would have an "iptables"
+provider. Alternately, you can use ufw, with Opscode's `ufw` and
+`firewall` cookbooks to set up rules. See those cookbooks' READMEs for
+documentation.
+
+Build/compile tools may not be installed on the system by default.
+Some recipes (e.g., `apache2::mod_auth_openid`) build the module from
+source. Use Opscode's `build-essential` cookbook to get essential
+build packages installed.
+
+On ArchLinux, if you are using the `apache2::mod_auth_openid` recipe,
+you also need the `pacman` cookbook for the `pacman_aur` LWRP. Put
+`recipe[pacman]` on the node's expanded run list (on the node or in a
+role). This is not an explicit dependency because it is only required
+for this single recipe and platform; the pacman default recipe
+performs `pacman -Sy` to keep pacman's package cache updated.
+
+The `apache2::god_monitor` recipe uses a definition from the `god`
+cookbook. Include `recipe[god]` in the node's expanded run list to
+ensure that the cookbook is available to the node, and to set up `god`.
-On Ubuntu/Debian, use Opscode's `apt` cookbook to ensure the package cache is updated so Chef can install packages, or consider putting apt-get in your bootstrap process or [knife bootstrap template](http://wiki.opscode.com/display/chef/Knife+Bootstrap).
+## Platforms:
-On RHEL, SELinux is enabled by default. The `selinux` cookbook contains a `permissive` recipe that can be used to set SELinux to "Permissive" state. Otherwise, additional recipes need to be created by the user to address SELinux permissions.
+The following platforms and versions are tested and supported using
+Opscode's [test-kitchen](http://github.com/opscode/test-kitchen).
-The easiest but **certainly not ideal way** to deal with IPtables is to flush all rules. Opscode does provide an `iptables` cookbook but is migrating from the approach used there to a more robust solution utilizing a general "firewall" LWRP that would have an "iptables" provider. Alternately, you can use ufw, with Opscode's `ufw` and `firewall` cookbooks to set up rules. See those cookbooks' READMEs for documentation.
+* Ubuntu 10.04, 12.04
+* CentOS 5.8, 6.3
-Build/compile tools may not be installed on the system by default. Some recipes (e.g., `apache2::mod_auth_openid`) build the module from source. Use Opscode's `build-essential` cookbook to get essential build packages installed.
+The following platform families are supported in the code, and are
+assumed to work based on the successful testing on Ubuntu and CentOS.
-On ArchLinux, if you are using the `apache2::mod_auth_openid` recipe, you also need the `pacman` cookbook for the `pacman_aur` LWRP. Put `recipe[pacman]` on the node's expanded run list (on the node or in a role). This is not an explicit dependency because it is only required for this single recipe and platform; the pacman default recipe performs `pacman -Sy` to keep pacman's package cache updated.
+* Debian
+* Red Hat (rhel)
+* Fedora
+* Amazon Linux
-The `apache2::god_monitor` recipe uses a definition from the `god` cookbook. Include `recipe[god]` in the node's expanded run list to ensure that the cookbook is downloaded.
+The following platforms are also supported in the code, have been
+tested manually but are not tested under test-kitchen.
-## Platforms:
-
-* Debian
-* Ubuntu
-* Red Hat/CentOS/Scientific Linux/Fedora (RHEL Family)
* SUSE/OpenSUSE
* ArchLinux
-* Amazon Linux AMI
* FreeBSD
### Notes for RHEL Family:
-On Red Hat Enterprise Linux and derivatives, the EPEL repository may be necessary to install packages used in certain recipes. The `apache2::default` recipe, however, does not require any additional repositories. Opscode's `yum` cookbook contains a recipe to add the EPEL repository. See __Examples__ for more information.
+On Red Hat Enterprise Linux and derivatives, the EPEL repository may
+be necessary to install packages used in certain recipes. The
+`apache2::default` recipe, however, does not require any additional
+repositories. Opscode's `yum` cookbook contains a recipe to add the
+EPEL repository. See __Examples__ for more information.
### Notes for FreeBSD:
-The `apache2::mod_php5` recipe depends on the `freebsd` cookbook, which it uses to set the correct options for compiling the `php5` port from sources. You need to ensure the `freebsd` is in the expanded run list, or this recipe will fail. We don't set an explicit dependency because we feel the `freebsd` cookbook is something users would want on their nodes, and due to the generality of this cookbook we don't want additional specific dependencies.
+The `apache2::mod_php5` recipe depends on the `freebsd` cookbook,
+which it uses to set the correct options for compiling the `php5` port
+from sources. You need to ensure the `freebsd` is in the expanded run
+list, or this recipe will fail. We don't set an explicit dependency
+because we feel the `freebsd` cookbook is something users would want
+on their nodes, and due to the generality of this cookbook we don't
+want additional specific dependencies.
Tests
=====
-This cookbook in the [source repository](https://github.com/opscode-cookbooks/apache2) contains minitest and cucumber tests. This is an initial proof of concept that will be fleshed out with more supporting infrastructure at a future time.
+This cookbook in the
+[source repository](https://github.com/opscode-cookbooks/apache2)
+contains minitest and cucumber tests. This is an initial proof of
+concept that will be fleshed out with more supporting infrastructure
+at a future time.
+
+Please see the CONTRIBUTING file for information on how to add tests
+for your contributions.
Attributes
==========
-This cookbook uses many attributes, broken up into a few different kinds.
+This cookbook uses many attributes, broken up into a few different
+kinds.
Platform specific
-----------------
-In order to support the broadest number of platforms, several attributes are determined based on the node's platform. See the attributes/default.rb file for default values in the case statement at the top of the file.
+In order to support the broadest number of platforms, several
+attributes are determined based on the node's platform. See the
+attributes/default.rb file for default values in the case statement at
+the top of the file.
* `node['apache']['dir']` - Location for the Apache configuration
* `node['apache']['log_dir']` - Location for Apache logs
@@ -84,7 +165,8 @@ In order to support the broadest number of platforms, several attributes are det
General settings
----------------
-These are general settings used in recipes and templates. Default values are noted.
+These are general settings used in recipes and templates. Default
+values are noted.
* `node['apache']['listen_ports']` - Ports that httpd should listen on. Default is an array of ports 80 and 443.
* `node['apache']['contact']` - Value for ServerAdmin directive. Default "ops@example.com".
@@ -99,7 +181,8 @@ The modules listed in `default_modules` will be included as recipes in `recipe[a
Prefork attributes
------------------
-Prefork attributes are used for tuning the Apache HTTPD prefork MPM configuration.
+Prefork attributes are used for tuning the Apache HTTPD prefork MPM
+configuration.
* `node['apache']['prefork']['startservers']` - initial number of server processes to start. Default is 16.
* `node['apache']['prefork']['minspareservers']` - minimum number of spare server processes. Default 16.
@@ -111,7 +194,8 @@ Prefork attributes are used for tuning the Apache HTTPD prefork MPM configuratio
Worker attributes
-----------------
-Worker attributes are used for tuning the Apache HTTPD worker MPM configuration.
+Worker attributes are used for tuning the Apache HTTPD worker MPM
+configuration.
* `node['apache']['worker']['startservers']` - Initial number of server processes to start. Default 4
* `node['apache']['worker']['maxclients']` - Maximum number of simultaneous connections. Default 1024.
@@ -122,7 +206,10 @@ Worker attributes are used for tuning the Apache HTTPD worker MPM configuration.
mod\_auth\_openid attributes
----------------------------
-The following attributes are in the `attributes/mod_auth_openid.rb` file. Like all Chef attributes files, they are loaded as well, but they're logistically unrelated to the others, being specific to the `mod_auth_openid` recipe.
+The following attributes are in the `attributes/mod_auth_openid.rb`
+file. Like all Chef attributes files, they are loaded as well, but
+they're logistically unrelated to the others, being specific to the
+`mod_auth_openid` recipe.
* `node['apache']['mod_auth_openid']['checksum']` - sha256sum of the tarball containing the source.
* `node['apache']['mod_auth_openid']['version']` - version of the `mod_auth_openid` to download.
@@ -133,21 +220,39 @@ The following attributes are in the `attributes/mod_auth_openid.rb` file. Like a
Recipes
=======
-Most of the recipes in the cookbook are for enabling Apache modules. Where additional configuration or behavior is used, it is documented below in more detail.
-
-The following recipes merely enable the specified module: `mod_alias`, `mod_basic`, `mod_digest`, `mod_authn_file`, `mod_authnz_ldap`, `mod_authz_default`, `mod_authz_groupfile`, `mod_authz_host`, `mod_authz_user`, `mod_autoindex`, `mod_cgi`, `mod_dav_fs`, `mod_dav_svn`, `mod_deflate`, `mod_dir`, `mod_env`, `mod_expires`, `mod_headers`, `mod_ldap`, `mod_log_config`, `mod_mime`, `mod_negotiation`, `mod_proxy`, `mod_proxy_ajp`, `mod_proxy_balancer`, `mod_proxy_connect`, `mod_proxy_http`, `mod_python`, `mod_rewrite`, `mod_setenvif`, `mod_status`, `mod_wsgi`, `mod_xsendfile`.
-
-On RHEL Family distributions, certain modules ship with a config file with the package. The recipes here may delete those configuration files to ensure they don't conflict with the settings from the cookbook, which will use per-module configuration in `/etc/httpd/mods-enabled`.
+Most of the recipes in the cookbook are for enabling Apache modules.
+Where additional configuration or behavior is used, it is documented
+below in more detail.
+
+The following recipes merely enable the specified module: `mod_alias`,
+`mod_basic`, `mod_digest`, `mod_authn_file`, `mod_authnz_ldap`,
+`mod_authz_default`, `mod_authz_groupfile`, `mod_authz_host`,
+`mod_authz_user`, `mod_autoindex`, `mod_cgi`, `mod_dav_fs`,
+`mod_dav_svn`, `mod_deflate`, `mod_dir`, `mod_env`, `mod_expires`,
+`mod_headers`, `mod_ldap`, `mod_log_config`, `mod_mime`,
+`mod_negotiation`, `mod_proxy`, `mod_proxy_ajp`, `mod_proxy_balancer`,
+`mod_proxy_connect`, `mod_proxy_http`, `mod_python`, `mod_rewrite`,
+`mod_setenvif`, `mod_status`, `mod_wsgi`, `mod_xsendfile`.
+
+On RHEL Family distributions, certain modules ship with a config file
+with the package. The recipes here may delete those configuration
+files to ensure they don't conflict with the settings from the
+cookbook, which will use per-module configuration in
+`/etc/httpd/mods-enabled`.
default
-------
-The default recipe does a number of things to set up Apache HTTPd. It also includes a number of modules based on the attribute `node['apache']['default_modules']` as recipes.
+The default recipe does a number of things to set up Apache HTTPd. It
+also includes a number of modules based on the attribute
+`node['apache']['default_modules']` as recipes.
logrotate
---------
-Logrotate adds a logrotate entry for your apache2 logs. This recipe requires the `logrotate` cookbook.
+Logrotate adds a logrotate entry for your apache2 logs. This recipe
+requires the `logrotate` cookbook; ensure that `recipe[logrotate]` is
+in the node's expanded run list.
mod\_auth\_cas
--------------
@@ -175,21 +280,32 @@ mod\_auth\_openid
**Changed via COOK-915**
-This recipe compiles the module from source. In addition to `build-essential`, some other packages are included for installation like the GNU C++ compiler and development headers.
+This recipe compiles the module from source. In addition to
+`build-essential`, some other packages are included for installation
+like the GNU C++ compiler and development headers.
-To use the module in your own cookbooks to authenticate systems using OpenIDs, specify an array of OpenIDs that are allowed to authenticate with the attribute `node['apache']['allowed_openids']`. Use the following in a vhost to protect with OpenID authentication:
+To use the module in your own cookbooks to authenticate systems using
+OpenIDs, specify an array of OpenIDs that are allowed to authenticate
+with the attribute `node['apache']['allowed_openids']`. Use the
+following in a vhost to protect with OpenID authentication:
- AuthType OpenID
- require user <%= node['apache']['allowed_openids'].join(' ') %>
+ AuthType OpenID require user <%= node['apache']['allowed_openids'].join(' ') %>
AuthOpenIDDBLocation <%= node['apache']['mod_auth_openid']['dblocation'] %>
-Change the DBLocation with the attribute as required; this file is in a different location than previous versions, see below. It should be a sane default for most platforms, though, see `attributes/mod_auth_openid.rb`.
+Change the DBLocation with the attribute as required; this file is in
+a different location than previous versions, see below. It should be a
+sane default for most platforms, though, see
+`attributes/mod_auth_openid.rb`.
### Changes from COOK-915:
* `AuthType OpenID` instead of `AuthOpenIDEnabled On`.
* `require user` instead of `AuthOpenIDUserProgram`.
-* A bug(?) in `mod_auth_openid` causes it to segfault when attempting to update the database file if the containing directory is not writable by the HTTPD process owner (e.g., www-data), even if the file is writable. In order to not interfere with other settings from the default recipe in this cookbook, the db file is moved.
+* A bug(?) in `mod_auth_openid` causes it to segfault when attempting
+ to update the database file if the containing directory is not
+ writable by the HTTPD process owner (e.g., www-data), even if the
+ file is writable. In order to not interfere with other settings from
+ the default recipe in this cookbook, the db file is moved.
mod\_fastcgi
------------
@@ -201,44 +317,69 @@ Only work on Debian/Ubuntu
mod\_fcgid
----------
-Installs the fcgi package and enables the module. Requires EPEL on RHEL family.
+Installs the fcgi package and enables the module. Requires EPEL on
+RHEL family.
-On RHEL family, this recipe will delete the fcgid.conf and on version 6+, create the /var/run/httpd/mod_fcgid` directory, which prevents the emergency error:
+On RHEL family, this recipe will delete the fcgid.conf and on version
+6+, create the /var/run/httpd/mod_fcgid` directory, which prevents the
+emergency error:
[emerg] (2)No such file or directory: mod_fcgid: Can't create shared memory for size XX bytes
mod\_php5
--------
-Simply installs the appropriate package on Debian, Ubuntu and ArchLinux.
+Simply installs the appropriate package on Debian, Ubuntu and
+ArchLinux.
-On Red Hat family distributions including Fedora, the php.conf that comes with the package is removed. On RHEL platforms less than v6, the `php53` package is used.
+On Red Hat family distributions including Fedora, the php.conf that
+comes with the package is removed. On RHEL platforms less than v6, the
+`php53` package is used.
mod\_ssl
--------
-Besides installing and enabling `mod_ssl`, this recipe will append port 443 to the `node['apache']['listen_ports']` attribute array and update the ports.conf.
+Besides installing and enabling `mod_ssl`, this recipe will append
+port 443 to the `node['apache']['listen_ports']` attribute array and
+update the ports.conf.
god\_monitor
------------
-Sets up a `god` monitor for Apache. External requirements are the `god` and `runit` cookbooks from Opscode. When using this recipe, include `recipe[god]` in the node's expanded run list to ensure the client downloads it; `god` depends on runit so that will also be downloaded.
+Sets up a `god` monitor for Apache. External requirements are the
+`god` and `runit` cookbooks from Opscode. When using this recipe,
+include `recipe[god]` in the node's expanded run list to ensure the
+client downloads it; `god` depends on runit so that will also be
+downloaded.
+
+**Note** This recipe is not tested under test-kitchen yet and is
+ pending fix in COOK-744.
Definitions
===========
-The cookbook provides a few definitions. At some point in the future these definitions may be refactored into lightweight resources and providers.
+The cookbook provides a few definitions. At some point in the future
+these definitions may be refactored into lightweight resources and
+providers as suggested by
+[foodcritic rule FC015](http://acrmp.github.com/foodcritic/#FC015).
apache\_conf
------------
-Sets up configuration file for an Apache module from a template. The template should be in the same cookbook where the definition is used. This is used by the `apache_module` definition and is not often used directly.
+Sets up configuration file for an Apache module from a template. The
+template should be in the same cookbook where the definition is used.
+This is used by the `apache_module` definition and is not often used
+directly.
-This will use a template resource to write the module's configuration file in the `mods-available` under the Apache configuration directory (`node['apache']['dir']`). This is a platform-dependent location. See __apache\_module__.
+This will use a template resource to write the module's configuration
+file in the `mods-available` under the Apache configuration directory
+(`node['apache']['dir']`). This is a platform-dependent location. See
+__apache\_module__.
### Parameters:
-* `name` - Name of the template. When used from the `apache_module`, it will use the same name as the module.
+* `name` - Name of the template. When used from the `apache_module`,
+ it will use the same name as the module.
### Examples:
@@ -249,7 +390,12 @@ Create `#{node['apache']['dir']}/mods-available/alias.conf`.
apache\_module
--------------
-Enable or disable an Apache module in `#{node['apache']['dir']}/mods-available` by calling `a2enmod` or `a2dismod` to manage the symbolic link in `#{node['apache']['dir']}/mods-enabled`. If the module has a configuration file, a template should be created in the cookbook where the definition is used. See __Examples__.
+Enable or disable an Apache module in
+`#{node['apache']['dir']}/mods-available` by calling `a2enmod` or
+`a2dismod` to manage the symbolic link in
+`#{node['apache']['dir']}/mods-enabled`. If the module has a
+configuration file, a template should be created in the cookbook where
+the definition is used. See __Examples__.
### Parameters:
@@ -283,9 +429,13 @@ See the recipes directory for many more examples of `apache_module`.
apache\_site
------------
-Enable or disable a VirtualHost in `#{node['apache']['dir']}/sites-available` by calling a2ensite or a2dissite to manage the symbolic link in `#{node['apache']['dir']}/sites-enabled`.
+Enable or disable a VirtualHost in
+`#{node['apache']['dir']}/sites-available` by calling a2ensite or
+a2dissite to manage the symbolic link in
+`#{node['apache']['dir']}/sites-enabled`.
-The template for the site must be managed as a separate resource. To combine the template with enabling a site, see `web_app`.
+The template for the site must be managed as a separate resource. To
+combine the template with enabling a site, see `web_app`.
### Parameters:
@@ -295,31 +445,43 @@ The template for the site must be managed as a separate resource. To combine the
web\_app
--------
-Manage a template resource for a VirtualHost site, and enable it with `apache_site`. This is commonly done for managing web applications such as Ruby on Rails, PHP or Django, and the default behavior reflects that. However it is flexible.
+Manage a template resource for a VirtualHost site, and enable it with
+`apache_site`. This is commonly done for managing web applications
+such as Ruby on Rails, PHP or Django, and the default behavior
+reflects that. However it is flexible.
-This definition includes some recipes to make sure the system is configured to have Apache and some sane default modules:
+This definition includes some recipes to make sure the system is
+configured to have Apache and some sane default modules:
* `apache2`
* `apache2::mod_rewrite`
* `apache2::mod_deflate`
* `apache2::mod_headers`
-It will then configure the template (see __Parameters__ and __Examples__ below), and enable or disable the site per the `enable` parameter.
+It will then configure the template (see __Parameters__ and
+__Examples__ below), and enable or disable the site per the `enable`
+parameter.
### Parameters:
Current parameters used by the definition:
-* `name` - The name of the site. The template will be written to `#{node['apache']['dir']}/sites-available/#{params['name']}.conf`
-* `cookbook` - Optional. Cookbook where the source template is. If this is not defined, Chef will use the named template in the cookbook where the definition is used.
+* `name` - The name of the site. The template will be written to
+ `#{node['apache']['dir']}/sites-available/#{params['name']}.conf`
+* `cookbook` - Optional. Cookbook where the source template is. If
+ this is not defined, Chef will use the named template in the
+ cookbook where the definition is used.
* `template` - Default `web_app.conf.erb`, source template file.
* `enable` - Default true. Passed to the `apache_site` definition.
-Additional parameters can be defined when the definition is called in a recipe, see __Examples__.
+Additional parameters can be defined when the definition is called in
+a recipe, see __Examples__.
### Examples:
-All parameters are passed into the template. You can use whatever you like. The apache2 cookbook comes with a `web_app.conf.erb` template as an example. The following parameters are used in the template:
+All parameters are passed into the template. You can use whatever you
+like. The apache2 cookbook comes with a `web_app.conf.erb` template as
+an example. The following parameters are used in the template:
* `server_name` - ServerName directive.
* `server_aliases` - ServerAlias directive. Must be an array of aliases.
@@ -342,12 +504,17 @@ The parameters specified will be used as:
In the template. When you write your own, the `@` is significant.
-For more information about Definitions and parameters, see the [Chef Wiki](http://wiki.opscode.com/display/chef/Definitions)
+For more information about Definitions and parameters, see the
+[Chef Wiki](http://wiki.opscode.com/display/chef/Definitions)
Usage
=====
-Using this cookbook is relatively straightforward. Add the desired recipes to the run list of a node, or create a role. Depending on your environment, you may have multiple roles that use different recipes from this cookbook. Adjust any attributes as desired. For example, to create a basic role for web servers that provide both HTTP and HTTPS:
+Using this cookbook is relatively straightforward. Add the desired
+recipes to the run list of a node, or create a role. Depending on your
+environment, you may have multiple roles that use different recipes
+from this cookbook. Adjust any attributes as desired. For example, to
+create a basic role for web servers that provide both HTTP and HTTPS:
% cat roles/webserver.rb
name "webserver"
@@ -362,29 +529,30 @@ Using this cookbook is relatively straightforward. Add the desired recipes to th
}
)
-For examples of using the definitions in your own recipes, see their respective sections above.
+For examples of using the definitions in your own recipes, see their
+respective sections above.
License and Authors
===================
-Author:: Adam Jacob <adam@opscode.com>
-Author:: Joshua Timberman <joshua@opscode.com>
-Author:: Bryan McLellan <bryanm@widemile.com>
-Author:: Dave Esposito <esposito@espolinux.corpnet.local>
-Author:: David Abdemoulaie <github@hobodave.com>
-Author:: Edmund Haselwanter <edmund@haselwanter.com>
-Author:: Eric Rochester <err8n@virginia.edu>
-Author:: Jim Browne <jbrowne@42lines.net>
-Author:: Matthew Kent <mkent@magoazul.com>
-Author:: Nathen Harvey <nharvey@customink.com>
-Author:: Ringo De Smet <ringo.de.smet@amplidata.com>
-Author:: Sean OMeara <someara@opscode.com>
-Author:: Seth Chisamore <schisamo@opscode.com>
-Author:: Gilles Devaux <gilles@peerpong.com>
-
-Copyright:: 2009-2011, Opscode, Inc
-Copyright:: 2011, Atriso
-Copyright:: 2011, CustomInk, LLC.
+* Author:: Adam Jacob <adam@opscode.com>
+* Author:: Joshua Timberman <joshua@opscode.com>
+* Author:: Bryan McLellan <bryanm@widemile.com>
+* Author:: Dave Esposito <esposito@espolinux.corpnet.local>
+* Author:: David Abdemoulaie <github@hobodave.com>
+* Author:: Edmund Haselwanter <edmund@haselwanter.com>
+* Author:: Eric Rochester <err8n@virginia.edu>
+* Author:: Jim Browne <jbrowne@42lines.net>
+* Author:: Matthew Kent <mkent@magoazul.com>
+* Author:: Nathen Harvey <nharvey@customink.com>
+* Author:: Ringo De Smet <ringo.de.smet@amplidata.com>
+* Author:: Sean OMeara <someara@opscode.com>
+* Author:: Seth Chisamore <schisamo@opscode.com>
+* Author:: Gilles Devaux <gilles@peerpong.com>
+
+* Copyright:: 2009-2012, Opscode, Inc
+* Copyright:: 2011, Atriso
+* Copyright:: 2011, CustomInk, LLC.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
View
2  metadata.rb
@@ -3,7 +3,7 @@
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.1.16"
+version "1.2.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"
Please sign in to comment.
Something went wrong with that request. Please try again.