Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

The httpd cookbook has been deprecated

Author provided reason for deprecation:

The httpd cookbook has been deprecated and is no longer being maintained by its authors. Use of the httpd cookbook is no longer recommended.

You may find that the apache2 cookbook is a suitable alternative.

RSS

httpd (47) Versions 0.5.1

Provides httpd_service, httpd_config, and httpd_module resources

Policyfile
Berkshelf
Knife
cookbook 'httpd', '= 0.5.1', :supermarket
cookbook 'httpd', '= 0.5.1'
knife supermarket install httpd
knife supermarket download httpd
README
Dependencies
Changelog
Quality 100%

HTTPD Cookbook

Build Status Cookbook Version

The HTTPD Cookbook is a Library Cookbook that provides resource primitives for use in recipes. It is designed to be an example to reference for creating highly re-usable cross platform cookbooks.

Scope

This cookbook is concerned with The Apache HTTP Server, particularly those shipped with F/OSS Unix and Linux distributions. It does not address other httpd server implementations like Lighttpd, Nginx, or IIS.

Requirements

  • Chef 12.7 or higher
  • Network accessible package repositories

Platform Support

The following platforms have been tested with Test Kitchen:

|----------------+-----+-----|
|                | 2.2 | 2.4 |
|----------------+-----+-----|
| amazon linux   |     | X   |
|----------------+-----+-----|
| debian-7       | X   |     |
|----------------+-----+-----|
| debian-8       |     | X   |
|----------------+-----+-----|
| ubuntu-14.04   |     | X   |
|----------------+-----+-----|
| ubuntu-16.04   |     | X   |
|----------------+-----+-----|
| centos-6       | X   |     |
|----------------+-----+-----|
| centos-7       |     | X   |
|----------------+-----+-----|
| fedora-25      |     | X   |
|----------------+-----+-----|
| opensuse-42    |     | X   |
|----------------+-----+-----|

Cookbook Dependencies

  • none

Usage

Place a dependency on the httpd cookbook in your cookbook's metadata.rb

depends 'httpd'

Then, in a recipe:

httpd_service 'default' do
  action [:create, :start]
end

httpd_config 'default' do
  source 'mysite.cnf.erb'
  notifies :restart, 'httpd_service[default]'
  action :create
end

Resources Overview

httpd_service

The httpd_service does minimal configuration to get the service up and running. Its parameters can select and tune the multi-processing module, along with a small selection of server-wide configuration options such as listen_ports and run_user.

The :create action handles package installation, support directories, socket files, and other operating system level concerns. The internal configuration file contains just enough to get the service up and running, then loads extra configuration from a conf.d directory. Further configurations are managed with the httpd_config resource.

The :start, :stop, :restart, and :reload actions use the appropriate provider for the platform to respectively start, stop, restart, and reload the service on the machine. You should omit the :start action in recipes designed to build containers.

httpd_service supports multiple Apache instances on a single machine, enabling advanced Apache configuration in scenarios where multiple servers need different loaded modules and global configurations.

Examples

httpd_service 'default' do
  action :create
end

httpd_service 'instance-1' do
  listen_ports ['81', '82']
  action :create
end

httpd_service 'an websites' do
  instance_name 'bob'
  servername 'www.computers.biz'
  version '2.4'
  mpm 'event'
  threadlimit '4096'
  listen_ports ['1234']
  action :create
end

Properties

Most of the parameters on the httpd_service resource map to their CamelCase equivalents found at http://httpd.apache.org/docs/2.4/mod/directives.html

  • contact - The email address rendered into the main configuration file as the ServerAdmin directive.
  • hostname_lookups - Enables DNS lookups on client IP addresses. Can be 'on' 'off' or 'double'. Defaults to 'off'.
  • instance - A string name to identify the httpd_service instance. By convention, this will result in configuration, log, and support directories being created and used in the form '/etc/instance-name', '/var/log/instance-name', etc. If set to 'default', the platform native defaults are used.
  • keepalive - Enables HTTP persistent connections. Values can be true or false.
  • keepalivetimeout - Amount of time the server will wait for subsequent requests on a persistent connection.
  • listen_addresses - IP addresses that the server listens to. Defaults to ['0.0.0.0'].
  • listen_ports - Ports that the server listens to. Defaults to ['80'].
  • log_level - Controls the verbosity of the ErrorLog. Defaults to 'warn'.
  • maxclients - Maximum number of connections that will be processed simultaneously. Valid only with prefork and worker MPMs.
  • maxconnectionsperchild - Limit on the number of connections that an individual child server will handle during its life. Valid with Apache 2.4 prefork, worker and event MPMs.
  • maxkeepaliverequests - Number of requests allowed on a persistent connection. Defaults to 100.
  • maxrequestsperchild - The Apache 2.2 version of maxconnectionsperchild. Still supported as of 2.4
  • maxrequestworkers - Maximum number of connections that will be processed simultaneously. Valid on prefork, worker, and event MPMs.
  • maxspareservers - Maximum number of idle child server processes. Valid only for prefork MPM.
  • maxsparethreads - Maximum number of idle threads. Valid only for worker and event MPMs.
  • minspareservers - Minimum number of idle child server processes. Valid only for preform MPM.
  • minsparethreads - Minimum number of idle threads available to handle request spikes. Valid only for worker and event MPMs.
  • modules - A list of initial Apache modules to be loaded inside the httpd_service instance. Defaults to Debian standard on 2.2 and 2.4.
  • mpm - The Multi-Processing Module to use for the httpd_service instance. Values can be 'prefork', 'worker', and 'event'. Defaults to 'worker' for Apache 2.2 and 'event' for Apache 2.4.
  • package_name - Name of the server package to install on the machine using the system package manager. Defaults to 'apache2' on Debian and 'httpd' on RHEL.
  • run_group - System group to start the httpd_service as. Defaults to 'www-data' on Debian and 'apache' on RHEL.
  • run_user - System user to start the httpd_service as. Defaults to 'www-data' on Debian and 'apache' on RHEL.
  • servername - Hostname and port that the server uses to identify itself. Syntax: [scheme://]fully-qualified-domain-name[:port]. Defaults to node['hostname'].
  • startservers - Number of child server processes created at startup. Valid for prefork, worker, and event MPMs. Default value differs from MPM to MPM.
  • threadlimit - Sets the upper limit on the configurable number of threads per child process. Valid on worker and event MPMs.
  • threadsperchild - Number of threads created by each child process. Valid on worker and event MPMs.
  • timeout - Amount of time the server will wait for certain events before failing a request. Defaults to '400'
  • version - Apache software version to use. Available options are '2.2', and '2.4', depending on platform. Defaults to latest available.

httpd_module

The httpd_module resource is responsible ensuring that an Apache module is installed on the system, as well as ensuring a load configuration snippet is dropped off at the appropriate location.

Examples

httpd_module 'ssl' do
  action :create
end

httpd_module 'el dap' do
  module_name 'ldap'
  action :create
end

httpd_module 'auth_pgsql' do
  instance 'instance-2'
  action :create
end

Properties

  • filename - The filename of the shared object to be rendered into the load config snippet. This can usually be omitted, and defaults to a generated value looked up in an internal map.
  • httpd_version - The version of the httpd_service this module is meant to be installed for. Useful on platforms that support multiple Apache versions. Defaults to the platform default.
  • instance - The httpd_service name to drop the load snippet off for. Defaults to 'default'.
  • module_name - The module name to install. Defaults to the httpd_module name.
  • package_name - The package name the module is found in. By default, this is looked up in an internal map.

httpd_config

The httpd_config resource is responsible for creating and deleting site specific configuration files on the system. There are slight differences in the resource implementation on platforms. The httpd_config resource is a thin wrapper around the core Chef template resource. Instead of a path parameter, httpd_config uses the instance parameter to calculate where the config is dropped off.

Check the Apache HTTP Server Project documentation for configuration specifics based on Apache version.

Examples

httpd_config 'mysite' do
  source 'mysite.erb'
  action :create
end

httpd_config 'computers dot biz ssl_config' do
  config_name 'ssl-config'
  instance 'computers_dot_biz'
  source 'ssl_config.erb'
  action :create
end

Properties

  • config_name - The name of the config on disk
  • cookbook - The cookbook that the source template is found in. Defaults to the current cookbook.
  • httpd_version - Used to calculate the configuration's disk path. Defaults to the platform's native Apache version.
  • instance - The httpd_service instance the config is meant for. Defaults to 'default'
  • source - The ERB format template source used to render the file.
  • variables - A hash of variables passed to the underlying template resource

Maintainers

This cookbook is maintained by Chef's Community Cookbook Engineering team. Our goal is to improve cookbook quality and to aid the community in contributing to cookbooks. To learn more about our team, process, and design goals see our team documentation. To learn more about contributing to cookbooks like this see our contributing documentation, or if you have general questions about this cookbook come chat with us in #cookbok-engineering on the Chef Community Slack

License

Copyright: 2008-2017, Chef Software, 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.

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

yum_dag Applicable Versions

httpd Cookbook CHANGELOG

This file is used to list changes made in each version of the httpd cookbook.

0.5.1 (2017-10-19)

  • Don't delete directory mods-available with delete action.

0.5.0 (2017-08-23)

Breaking changes

  • Remove support for OmniOS / SmartOS, which didn't actually work before
  • Remove support for EOL CentOS 5 / Ubuntu 12.04
  • Remove compat_resource and instead require Chef 12.7+
  • Service creation has been moved from the :start action to the :create action to follow user exceptions. Existing cookbooks using the service resource will need to be updated to use the create action in addition to the start action.

Other Changes

  • The service resource have been DRYed up
  • Use a SPDX compliant license string to resolve FoodCritic warnings
  • Switch from Rakefile testing to Delivery local mode
  • Add support for Amazon Linux 2017 and simplify Amazon detection so we don't have to repeat this next year
  • Remove Chef 12.0 compatibility code to simplify init system detection
  • Resolve all CHEF-19 deprecation warnings

0.4.5 (2017-02-13)

  • Resolve Issue #104 with use of security module on RHEL 7.2

0.4.4 (2016-09-27)

  • Explicitly using new_resource.version in guard clause Centos/RHEL
  • Add net-tools to docker configuration

0.4.3 (2016-09-27)

  • Explicitly using new_resource.version in guard clause Ubuntu

0.4.2 (2016-09-27)

  • Release reflecting new dep on compat_resource 12.14.6

0.4.1 (2016-09-23)

  • Fix incompatibilities with the new releases of compat_resource
  • Require a more recent compat_resource cookbook to resolve notification issues
  • Switch linting to cookstyle
  • Fix documentation for httpd_config in the README
  • Resolve Foodcritic warnings
  • Fix systemd start timeout on ubuntu 16.04
  • Avoid node.set deprecation notices in the specs

0.4.0 (2016-05-31)

  • Removed support for end of life platforms: Ubuntu 10.04, 13.04, 13.10, 14.10 and Suse 12.X
  • Added support for Amazon 2016.X
  • Added support for opensuse / opensuseleap
  • Added support for modern Fedora releases and changed the code so we don't have to perform a new release every time Fedora ships
  • Moved systemd unit files to /etc/system instead of /usr/lib/systemd
  • Resolved nil deprecation notices in the various providers
  • Removed the installation of net-tools, which is only required for integration testing. Moved this to the actual test recipe instead
  • Updated kitchen-dokken config to use the latest Chef client and additional platforms
  • Added back a standard .kitchen.yml file for local testing
  • Fixed the test suites in Test Kitchen to reflect what Apache versions actually exist on platforms
  • Added a Gemfile for testing dependencies
  • Removed the Guardfile
  • Updated .gitignore and chefignore files
  • Added a .foodcritic file to disable FC005 and FC023
  • Added a Rakefile for simplied testing
  • Updated the specs to test on more recent platforms
  • Converted integration tests to inspec
  • Added initial, yet incomplete, support for Debian 8 / Ubuntu 16.04. Service management is still lacking and will ship in a future release
  • Removed smartos / omnios as tested platforms

0.3.6 (2016-04-27)

  • fix some of the copious warnings about 'invalid default value' #63 @cmenning
  • Added package name to httpd_module and fixed httpd_version to match resource attribute parameter #62 @ikari7789
  • Fix delete action for RHEL that was not removing config files correctly #74 @darrylb-github

0.3.5 (2016-03-21)

  • bug fix for #66, resolving run directories on reboot on rhel family systems using systemd @gitjoey and @odoell

0.3.4 (2016-01-26)

  • bug fix for #56, ambiguous version method in sysvinit manager

0.3.3 (2015-11-30)

  • bug fix for 32 bit support on RHEL platforms

0.3.2 (2015-10-28)

  • depending on compat_resource >= 12.5.11

0.3.1 (2015-10-28)

  • Fixed bug in rhel sysvinit provider
  • style fixes

0.3.0 (2015-10-08)

  • Heavy refactoring, converting to 12.5 resources with 12.x backcompat
  • Removed fugly resource titles, which explodes ChefSpec.
  • Commented out a ton of specs, still getting various clone warnings.

0.2.19 (2015-09-15)

  • Updating for Amazon Linux 2015.03

0.2.18 (2015-06-30)

  • Fixes for correct Provider Resolver behavior and more 12.4.0 fixes

0.2.17 (2015-06-28)

  • Fixing IfModule by including .load before .conf

0.2.16 (2015-06-26)

  • Dropping Chef 11 support
  • fix the priority map dsl method

0.2.15 (2015-06-26)

  • Fixing up provider resolution code to work properly with 12.4

0.2.14 (2015-06-05)

  • Fixing up mod_php filename for debian based distros

v0.2.12 (2015-05-11)

  • Fixing 'provides' bug that was breaking 12.3

v0.2.11 (2015-04-11)

  • Fix config file load ordering

v0.2.10 (2015-04-06)

  • Various README fixes
  • Fixing action :delete for httpd_config rhel provider

v0.2.9 (2015-04-04)

  • Adding CONTRIBUTING.md
  • Adding issues and source urls to metadata

v0.2.8 (2015-03-20)

  • Fixing backwards compatibility with Chef 11

v0.2.7 (2015-03-16)

  • Updating resources and providers to use "provides" keyword instead of the old provider_mapping file

v0.2.6 (2015-01-20)

  • Fixed type mismatch bug for listen_addresses parameter
  • Fixing up php-zts for el5/6

v0.2.5 (2015-01-20)

  • Fixing mpm_worker config rendering

v0.2.4 (2015-01-19)

  • Refactoring helper methods out of resource classes. Fixing up tests.

v0.2.3 (2015-01-17)

  • Fixing httpd_module 'php' on rhel family

v0.2.2 (2015-01-12)

  • Adding license and description metadata

v0.2.1 (2015-01-12)

  • Adding platform support metadata

v0.2.0 (2014-12-31)

  • Providers now avoid "system" httpd service for default instance
  • Refactoring helper libraries
  • Refactoring package info and mpm DSLs
  • Adding more platform support
  • Refactoring specs.. removing everything but centos-5 for now

v0.1.7 (2014-12-19)

  • Reverting 0.1.6 changes

v0.1.6 (2014-12-19)

  • Using "include" instead of "extend" for helper methods

v0.1.5 (2014-08-24)

  • Adding a modules parameter to httpd_service resource. It now loads a base set of modules by default

v0.1.4 (2014-08-23)

  • Renaming magic to mime.types

v0.1.3 (2014-08-22)

  • Fixing notifications by using LWRP DSL actions

v0.1.2 (2014-08-22)

  • Fixing up maxkeepaliverequests in template

v0.1.1 (2014-08-22)

  • Fixing up maxkeepaliverequests parameter

v0.1.0 (2014-08-22)

  • Initial Beta release. Let the bug hunts begin!

Collaborator Number Metric
            

0.5.1 passed this metric

Contributing File Metric
            

0.5.1 passed this metric

Foodcritic Metric
            

0.5.1 passed this metric

License Metric
            

0.5.1 passed this metric

No Binaries Metric
            

0.5.1 passed this metric

Testing File Metric
            

0.5.1 passed this metric

Version Tag Metric
            

0.5.1 passed this metric