Downgrade mysql cookbook for now

It doesn't play well with our current dev server setup
This commit is contained in:
Greg Karékinian 2017-06-16 22:43:51 +02:00
parent e39792ea36
commit bdfb3a1afb
398 changed files with 12716 additions and 10889 deletions

4
Batali
View File

@ -30,12 +30,12 @@ Batali.define do
cookbook 'firewall', '~> 2.6.2' cookbook 'firewall', '~> 2.6.2'
cookbook 'chef_nginx', '~> 6.1.1' cookbook 'chef_nginx', '~> 6.1.1'
cookbook 'build-essential', '~> 8.0.3' cookbook 'build-essential', '~> 8.0.3'
cookbook 'mysql', '~> 8.4.0' cookbook 'mysql', '= 6.1.3'
cookbook 'postgresql', '~> 6.1.1' cookbook 'postgresql', '~> 6.1.1'
# Deprecated, but wordpress and mediawiki depend on it and it would painful # Deprecated, but wordpress and mediawiki depend on it and it would painful
# to change it without moving the databases # to change it without moving the databases
cookbook 'database' cookbook 'database'
cookbook 'mysql2_chef_gem', '~> 2.0.1' cookbook 'mysql2_chef_gem', '= 1.1.0'
cookbook 'chef_client_updater', '~> 1.1.1' cookbook 'chef_client_updater', '~> 1.1.1'
cookbook 'timezone_iii', '~> 1.0.4' cookbook 'timezone_iii', '~> 1.0.4'
cookbook 'nodejs', '~> 3.0.0' cookbook 'nodejs', '~> 3.0.0'

View File

@ -46,11 +46,11 @@
"dependencies": [ "dependencies": [
], ],
"version": "3.1.0", "version": "3.3.0",
"source": { "source": {
"type": "Batali::Source::Site", "type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/apache2/versions/3.1.0/download", "url": "https://supermarket.chef.io:443/api/v1/cookbooks/apache2/versions/3.3.0/download",
"version": "3.1.0" "version": "3.3.0"
} }
}, },
{ {
@ -118,27 +118,27 @@
"name": "windows", "name": "windows",
"dependencies": [ "dependencies": [
[ [
"chef_handler", "ohai",
">= 0.0.0" ">= 4.0.0"
] ]
], ],
"version": "1.38.4", "version": "3.1.1",
"source": { "source": {
"type": "Batali::Source::Site", "type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/windows/versions/1.38.4/download", "url": "https://supermarket.chef.io:443/api/v1/cookbooks/windows/versions/3.1.1/download",
"version": "1.38.4" "version": "3.1.1"
} }
}, },
{ {
"name": "chef_handler", "name": "ohai",
"dependencies": [ "dependencies": [
], ],
"version": "1.3.0", "version": "5.0.4",
"source": { "source": {
"type": "Batali::Source::Site", "type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/chef_handler/versions/1.3.0/download", "url": "https://supermarket.chef.io:443/api/v1/cookbooks/ohai/versions/5.0.4/download",
"version": "1.3.0" "version": "5.0.4"
} }
}, },
{ {
@ -162,41 +162,86 @@
[ [
"build-essential", "build-essential",
">= 0.0.0" ">= 0.0.0"
],
[
"chef-sugar",
">= 0.0.0"
] ]
], ],
"version": "2.0.0", "version": "3.1.2",
"source": { "source": {
"type": "Batali::Source::Site", "type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/xml/versions/2.0.0/download", "url": "https://supermarket.chef.io:443/api/v1/cookbooks/xml/versions/3.1.2/download",
"version": "2.0.0" "version": "3.1.2"
}
},
{
"name": "chef-sugar",
"dependencies": [
],
"version": "3.3.0",
"source": {
"type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/chef-sugar/versions/3.3.0/download",
"version": "3.3.0"
} }
}, },
{ {
"name": "mysql", "name": "mysql",
"dependencies": [ "dependencies": [
[
"yum-mysql-community",
">= 0.0.0"
],
[
"smf",
">= 0.0.0"
]
], ],
"version": "8.4.0", "version": "6.1.3",
"source": { "source": {
"type": "Batali::Source::Site", "type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/mysql/versions/8.4.0/download", "url": "https://supermarket.chef.io:443/api/v1/cookbooks/mysql/versions/6.1.3/download",
"version": "8.4.0" "version": "6.1.3"
}
},
{
"name": "yum-mysql-community",
"dependencies": [
[
"compat_resource",
">= 12.16.3"
]
],
"version": "2.1.0",
"source": {
"type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/yum-mysql-community/versions/2.1.0/download",
"version": "2.1.0"
}
},
{
"name": "compat_resource",
"dependencies": [
],
"version": "12.19.0",
"source": {
"type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/compat_resource/versions/12.19.0/download",
"version": "12.19.0"
}
},
{
"name": "smf",
"dependencies": [
[
"rbac",
">= 1.0.1"
]
],
"version": "2.2.8",
"source": {
"type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/smf/versions/2.2.8/download",
"version": "2.2.8"
}
},
{
"name": "rbac",
"dependencies": [
],
"version": "1.0.3",
"source": {
"type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/rbac/versions/1.0.3/download",
"version": "1.0.3"
} }
}, },
{ {
@ -234,11 +279,11 @@
">= 1.0.0" ">= 1.0.0"
] ]
], ],
"version": "4.0.9", "version": "6.1.1",
"source": { "source": {
"type": "Batali::Source::Site", "type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/database/versions/4.0.9/download", "url": "https://supermarket.chef.io:443/api/v1/cookbooks/database/versions/6.1.1/download",
"version": "4.0.9" "version": "6.1.1"
} }
}, },
{ {
@ -264,18 +309,6 @@
"version": "6.1.1" "version": "6.1.1"
} }
}, },
{
"name": "compat_resource",
"dependencies": [
],
"version": "12.19.0",
"source": {
"type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/compat_resource/versions/12.19.0/download",
"version": "12.19.0"
}
},
{ {
"name": "openssl", "name": "openssl",
"dependencies": [ "dependencies": [
@ -319,18 +352,6 @@
"version": "6.1.1" "version": "6.1.1"
} }
}, },
{
"name": "ohai",
"dependencies": [
],
"version": "5.0.4",
"source": {
"type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/ohai/versions/5.0.4/download",
"version": "5.0.4"
}
},
{ {
"name": "zypper", "name": "zypper",
"dependencies": [ "dependencies": [
@ -348,22 +369,22 @@
"dependencies": [ "dependencies": [
[ [
"build-essential", "build-essential",
">= 2.4.0" ">= 0.0.0"
], ],
[ [
"mysql", "mysql",
">= 8.2.0" ">= 6.0"
], ],
[ [
"mariadb", "mariadb",
">= 0.0.0" ">= 0.0.0"
] ]
], ],
"version": "2.0.1", "version": "1.1.0",
"source": { "source": {
"type": "Batali::Source::Site", "type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/mysql2_chef_gem/versions/2.0.1/download", "url": "https://supermarket.chef.io:443/api/v1/cookbooks/mysql2_chef_gem/versions/1.1.0/download",
"version": "2.0.1" "version": "1.1.0"
} }
}, },
{ {
@ -485,14 +506,14 @@
"dependencies": [ "dependencies": [
[ [
"windows", "windows",
">= 1.34.6" ">= 2.0"
] ]
], ],
"version": "5.0.8", "version": "6.7.1",
"source": { "source": {
"type": "Batali::Source::Site", "type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/iis/versions/5.0.8/download", "url": "https://supermarket.chef.io:443/api/v1/cookbooks/iis/versions/6.7.1/download",
"version": "5.0.8" "version": "6.7.1"
} }
}, },
{ {
@ -500,11 +521,11 @@
"dependencies": [ "dependencies": [
], ],
"version": "2.0.0", "version": "2.1.1",
"source": { "source": {
"type": "Batali::Source::Site", "type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/tar/versions/2.0.0/download", "url": "https://supermarket.chef.io:443/api/v1/cookbooks/tar/versions/2.1.1/download",
"version": "2.0.0" "version": "2.1.1"
} }
}, },
{ {
@ -574,6 +595,18 @@
"version": "1.1.0" "version": "1.1.0"
} }
}, },
{
"name": "poise",
"dependencies": [
],
"version": "2.8.1",
"source": {
"type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/poise/versions/2.8.1/download",
"version": "2.8.1"
}
},
{ {
"name": "poise-build-essential", "name": "poise-build-essential",
"dependencies": [ "dependencies": [
@ -826,18 +859,6 @@
"version": "4.0.0" "version": "4.0.0"
} }
}, },
{
"name": "poise",
"dependencies": [
],
"version": "2.8.1",
"source": {
"type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/poise/versions/2.8.1/download",
"version": "2.8.1"
}
},
{ {
"name": "users", "name": "users",
"dependencies": [ "dependencies": [
@ -904,6 +925,18 @@
"version": "2.6.2" "version": "2.6.2"
} }
}, },
{
"name": "chef-sugar",
"dependencies": [
],
"version": "3.3.0",
"source": {
"type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/chef-sugar/versions/3.3.0/download",
"version": "3.3.0"
}
},
{ {
"name": "chef_client_updater", "name": "chef_client_updater",
"dependencies": [ "dependencies": [

View File

@ -0,0 +1,4 @@
~FC007
~FC015
~FC023
~FC024

View File

@ -2,6 +2,83 @@ apache2 Cookbook Changelog
========================== ==========================
This file is used to list changes made in each version of the apache2 cookbook. This file is used to list changes made in each version of the apache2 cookbook.
v3.3.0 (2017-04-11)
-------------------
- [GH-478] Added support for the amazon platform_family, outside of rhel
- [GH-474] Update Berksfile to allow fetching of newer
- [GH-473] Update copyright header format
- [GH-472] foodcritic: add sous-chefs rules
- add CODE_OF_CONDUCT
- [GH-471] FCGI paths should not be messed with on RHEL/CenOS 7. CentOS 7 (and recent Fedoras) have Apache 2.4, where FCGI socket path and shared memory path is managed adequately without further involvment neccessary (subdirectory is created under /var/run/httpd).
- [GH-470] Remove support for EOL Fedora < 18 / FreeBSD 9
- [GH-465] Testing updates
- [GH-469] Use the default cookbook style rules
- [GH-460] Serverspec to InSpec migration
- [GH-461] Update comment header format & other cookstyle fixes
- [GH-454] Test in Travis with Chef-DK and a Rakefile
- [GH-455] openSUSE Leap has it's own platform name
- [GH-279] leave stubs for rhel family `conf.d` files to avoid conflicts on package upgrade; no longer remove `conf.d`, just don't use it
- [GH-427] Add option to configure custom log level
- [GH-450] Ensure the lock_dir is owned by www-data for Apache 2.2 and 2.4 on Debian/Ubuntu
- Remove mod_auth_openid tests, as it is not part of the ASF release and plan to drop support for it and right now it is failing our tests
- [GH-440] Update default values in `apache.prefork` section of README
- [GH-443] fixed typo in copyright year
- Test on the latest chef with chef-zero
- Update supported platforms to Ubuntu 16.04, Debian 8.4, Centos 7.2; deprecating Ubuntu 12.04
- [GH-422] Fix uniq for nil:NilClass error introduced in 3.2.2
- [GH-423] allow for apache 2.4 usage on rhel < 7.0
- Cookbook is now part of the sous-chefs, but still maintained by the same folks
- mod_perl: No longer install libapache2-mpm-prefork
- mod_php: renamed mod_php5 to more generic mod_php; using php 7.0 where available
v3.2.2 (2016-04-13)
-------------------
- [GH-420] Allow auto-conversion if either of `apache.listen_ports` or `apache.listen_addresses` are set rather than '&&'. This ensures conversion occurs if only one of the two is set.
v3.2.1 (2016-04-11)
-------------------
- [GH-225] notify `restart` instead of `reload` service on `apache_conf`, `apache_config`
- Update to foodcritic 6
v3.2.0 (2016-03-26)
-------------------
- [GH-378] Deprecates `apache.listen_addresses` and `apache.listen_ports` infavor of [GH-409]
- [GH-409] `apache.listen` now accepts an array of `addr:port` strings
- [GH-358] FreeBSD: Update 10.1 support; Adds php 5.6 in collaboration with chef-cookbooks/php#119
- [GH-394] Have `apache.prefork.serverlimit` set ServerLimit directive on 2.4
- [GH-363] Escape '.' in regex for .htaccess/.htpasswd files
- [GH-365] Force log directory creation to be recursive
- [GH-368] Change the service creation to use the `apache.service_name` attribute throughout
- [GH-374] Make metadata.rb compatible with chef versions < 12.
- [GH-382] Fixed typo in node['platform_family'] for NameError in `mod_proxy_html`
- [GH-369] README: Added on Ubuntu `mod_fastcgi` requires `multiverse` apt repository to enabled.
- [GH-381] README: Add missing backtick
- [GH-384] README: Fix names for a2enconf and a2disconf
- [GH-393] README: mention availability of `mod_actions` support
- [GH-383] Debian: Add possibility to use other releases via `apache.default_release`
- [GH-377] Restart service when including `mod_headers` to allow healing of failed service because of missing directives.
- [GH-416] Change the default of `apache.mod_fastcgi.install_method` to 'package' all platforms, as `source` is no longer available.
- [GH-401] Move `mod_deflate` to `apache.default_modules` and no longer force installation on `debian` families.
- [GH-386] Do not install an extra mod_ssl package on SUSE Linux Enterprise
- [GH-335] Do not hardcoded reload/restart on more modern rhel platforms, allowing systemd on CentOS 7
- [GH-375] Install package `mod_ldap` on CentOS 7 (triggered by `apache.version` == 2.4)
- Update `apache.mod_ssl.cipher_suite` to latest from https://bettercrypto.org/
- README: Re-organize README to make it easier to find usage and remove old references.
- Added new standard and missing modules (Note: these may not be available natively on all operating systems)
* [mod_http2](http://httpd.apache.org/docs/2.4/mod/mod_http2.html) - Support for the HTTP/2 transport layer. (available since 2.4.17)
* [mod_authnz_fcgi](http://httpd.apache.org/docs/2.4/mod/mod_authnz_fcgi.html) - Enable FastCGI authorizer applications to authenticate and/or authorize clients. (available since 2.4.10)
* [mod_cern_meta](http://httpd.apache.org/docs/2.4/mod/mod_cern_meta.html) - CERN httpd metafile semantics
* [mod_ident](http://httpd.apache.org/docs/2.4/mod/mod_ident.html) - RFC 1413 ident lookups
* [mod_privileges](http://httpd.apache.org/docs/2.4/mod/mod_privileges.html) - Support for Solaris privileges and for running virtual hosts under different user IDs.
* [mod_socache_dc](http://httpd.apache.org/docs/2.4/mod/mod_socache_dc.html) - Distcache based shared object cache provider.
* [mod_version](http://httpd.apache.org/docs/2.4/mod/mod_version.html) - Version dependent configuration
* [mod_watchdog](http://httpd.apache.org/docs/2.4/mod/mod_watchdog.html) - Provides infrastructure for other modules to periodically run tasks
v3.1.0 (2015-05-25) v3.1.0 (2015-05-25)
------------------- -------------------

View File

@ -0,0 +1,105 @@
# Contributing to the apache2 cookbook
We are glad you want to contribute to the apache2 cookbook! The first
step is the desire to improve the project.
## Quick-contribute
* Create an issue on the github [issue tracker](https://github.com/sous-chefs/apache2/issues)
* Link to your patch as a rebased git branch or pull request from the ticket
We regularly review contributions and will get back to you if we have
any suggestions or concerns.
### Branches and Commits
You should submit your patch as a git branch named after the change.
It is a best practice to have your commit message have a _summary
line_, 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.
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
We don't require you to use Github, and we will even take patch diffs
attached to tickets on the issue 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.
## Functional and Unit Tests
This cookbook is set up to run tests under
[Test Kitchen](http://kitchen.ci/). It uses serverspec 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 Chef](http://chef.github.io/bento/).
Because Test Kitchen creates VirtualBox machines and runs through
every configuration in the .kitchen.yml file, 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 https://community-slack.chef.io/
## 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.chef.io/sympa/info/chef-dev)
or the https://community-slack.chef.io/
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).
Please do use [foodcritic](http://www.foodcritic.io/) 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, the maintainer
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.
We will update the CHANGELOG.md when releasing a new version of
the cookbook.

View File

@ -1,9 +1,9 @@
apache2 Cookbook apache2 Cookbook
================ ================
[![Cookbook Version](https://img.shields.io/cookbook/v/apache2.svg?style=flat)](https://supermarket.chef.io/cookbooks/apache2) [![Cookbook Version](https://img.shields.io/cookbook/v/apache2.svg?style=flat)](https://supermarket.chef.io/cookbooks/apache2)
[![Build Status](https://travis-ci.org/svanzoest-cookbooks/apache2.svg?branch=master)](https://travis-ci.org/svanzoest-cookbooks/apache2) [![Build Status](https://travis-ci.org/sous-chefs/apache2.svg?branch=master)](https://travis-ci.org/sous-chefs/apache2)
[![Dependency Status](http://img.shields.io/gemnasium/svanzoest-cookbooks/apache2.svg?style=flat)](https://gemnasium.com/svanzoest-cookbooks/apache2) [![Dependency Status](http://img.shields.io/gemnasium/sous-chefs/apache2.svg?style=flat)](https://gemnasium.com/sous-chefs/apache2)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/svanzoest-cookbooks/apache2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![License](https://img.shields.io/badge/license-Apache_2-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
This cookbook provides a complete Debian/Ubuntu style Apache HTTPD This cookbook provides a complete Debian/Ubuntu style Apache HTTPD
configuration. Non-Debian based distributions such as Red Hat/CentOS, configuration. Non-Debian based distributions such as Red Hat/CentOS,
@ -25,20 +25,6 @@ This cookbook ships with templates of these scripts for non
Debian/Ubuntu platforms. The scripts are used in the __Definitions__ Debian/Ubuntu platforms. The scripts are used in the __Definitions__
below. 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](https://supermarket.chef.io/cookbooks/apache2/versions/1.1.16).
## Cookbooks: ## Cookbooks:
This cookbook has no direct external dependencies. This cookbook has no direct external dependencies.
@ -50,35 +36,32 @@ settings may affect the behavior of this cookbook:
* apt cache outdated * apt cache outdated
* SELinux enabled * SELinux enabled
* IPtables * firewalls (such as iptables, ufw, etc.)
* Compile tools * Compile tools
* 3rd party repositories * 3rd party repositories
On Ubuntu/Debian, use Opscode's `apt` cookbook to ensure the package On Ubuntu/Debian, use [apt](https://supermarket.chef.io/cookbooks/apt) cookbook to ensure the package
cache is updated so Chef can install packages, or consider putting cache is updated so Chef can install packages, or consider putting
apt-get in your bootstrap process or apt-get in your bootstrap process or
[knife bootstrap template](http://docs.chef.io/knife_bootstrap.html) [knife bootstrap template](http://docs.chef.io/knife_bootstrap.html)
On RHEL, SELinux is enabled by default. The `selinux` cookbook On RHEL, SELinux is enabled by default. The [selinux](https://supermarket.chef.io/cookbooks/selinux) cookbook
contains a `permissive` recipe that can be used to set SELinux to contains a `permissive` recipe that can be used to set SELinux to
"Permissive" state. Otherwise, additional recipes need to be created "Permissive" state. Otherwise, additional recipes need to be created
by the user to address SELinux permissions. by the user to address SELinux permissions.
The easiest but **certainly not ideal way** to deal with IPtables is
to flush all rules. Chef Software does provide an `iptables` cookbook but is To deal with firewalls Chef Software does provide an [iptables](https://supermarket.chef.io/cookbooks/iptables) and [ufw](https://supermarket.chef.io/cookbooks/ufw) cookbook but is migrating from the approach used there to a more robust solution
migrating from the approach used there to a more robust solution utilizing the general [firewall](https://supermarket.chef.io/cookbooks/firewall) cookbook to setup rules.
utilizing a general "firewall" LWRP that would have an "iptables" See those cookbooks' READMEs for documentation.
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. Build/compile tools may not be installed on the system by default.
Some recipes (e.g., `apache2::mod_auth_openid`) build the module from Some recipes (e.g., `apache2::mod_auth_openid`) build the module from
source. Use Opscode's `build-essential` cookbook to get essential source. Use the [build-essential](https://supermarket.chef.io/cookbooks/build-essential) cookbook to get essential
build packages installed. build packages installed.
On ArchLinux, if you are using the `apache2::mod_auth_openid` recipe, On ArchLinux, if you are using the `apache2::mod_auth_openid` recipe,
you also need the `pacman` cookbook for the `pacman_aur` LWRP. Put you also need the [pacman](https://supermarket.chef.io/cookbooks/pacman) cookbook for the `pacman_aur` LWRP. Put
`recipe[pacman]` on the node's expanded run list (on the node or in a `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 role). This is not an explicit dependency because it is only required
for this single recipe and platform; the pacman default recipe for this single recipe and platform; the pacman default recipe
@ -89,20 +72,21 @@ performs `pacman -Sy` to keep pacman's package cache updated.
The following platforms and versions are tested and supported using The following platforms and versions are tested and supported using
[test-kitchen](http://kitchen.ci/) [test-kitchen](http://kitchen.ci/)
* Ubuntu 12.04, 14.04 * Ubuntu 14.04
* Debian 7.6 * Ubuntu 16.04
* CentOS 6.5, 7.0 * Debian 8.6
* CentOS 7.3
* Fedora 25
The following platform families are supported in the code, and are The following platform families are supported in the code, and are
assumed to work based on the successful testing on Ubuntu and CentOS. assumed to work based on the successful testing on Ubuntu and CentOS.
* Red Hat (rhel) * Red Hat (rhel)
* Fedora
* Amazon Linux
The following platforms are also supported in the code, have been The following platforms are also supported in the code, have been
tested manually but are not tested under test-kitchen. tested manually but are not regularly tested under test-kitchen.
* Amazon Linux
* SUSE/OpenSUSE * SUSE/OpenSUSE
* ArchLinux * ArchLinux
* FreeBSD * FreeBSD
@ -112,25 +96,37 @@ tested manually but are not tested under test-kitchen.
On Red Hat Enterprise Linux and derivatives, the EPEL repository may On Red Hat Enterprise Linux and derivatives, the EPEL repository may
be necessary to install packages used in certain recipes. The be necessary to install packages used in certain recipes. The
`apache2::default` recipe, however, does not require any additional `apache2::default` recipe, however, does not require any additional
repositories. Opscode's `yum-epel` cookbook can be used to add the repositories. The [yum-epel](https://supermarket.chef.io/cookbooks/yum-epel) cookbook can be used to add the
EPEL repository. See __Examples__ for more information. EPEL repository. See __Examples__ for more information.
### Notes for FreeBSD: Usage
Version 2.0 has been had some basic testing against FreeBSD 10.0 using
Chef 11.14.2 which has support for pkgng (CHEF-4637).
Tests
===== =====
This cookbook in the Using this cookbook is relatively straightforward. It is recommended to create
[source repository](https://github.com/svanzoest-cookbooks/apache2/) a project or organization specific [wrapper cookbook](https://www.chef.io/blog/2013/12/03/doing-wrapper-cookbooks-right/)
contains chefspec, serverspec and cucumber tests. This is an initial proof of and add the desired recipes to the run list of a node, or create a role. Depending on your
concept that will be fleshed out with more supporting infrastructure environment, you may have multiple roles that use different recipes
at a future time. from this cookbook. Adjust any attributes as desired. For example, to
create a basic role for web servers that provide both HTTP and HTTPS:
```ruby
% cat roles/webserver.rb
name "webserver"
description "Systems that serve HTTP and HTTPS"
run_list(
"recipe[apache2]",
"recipe[apache2::mod_ssl]"
)
default_attributes(
"apache" => {
"listen" => ["*:80", "*:443"]
}
)
```
For examples of using the definitions in your own recipes, see their
respective sections below.
Please see the CONTRIBUTING file for information on how to add tests
for your contributions.
Attributes Attributes
========== ==========
@ -164,7 +160,7 @@ the top of the file.
* `node['apache']['lib_dir']` - Location for shared libraries * `node['apache']['lib_dir']` - Location for shared libraries
* `node['apache']['default_site_enabled']` - Default site enabled. Default is false. * `node['apache']['default_site_enabled']` - Default site enabled. Default is false.
* `node['apache']['ext_status']` - if true, enables ExtendedStatus for `mod_status` * `node['apache']['ext_status']` - if true, enables ExtendedStatus for `mod_status`
* `node['apache']['locale'] - Locale to set in sysconfig or envvars and used for subprocesses and modules (like mod_dav and mod_wsgi). On debian systems Uses system-local if set to 'system', defaults to 'C'. * `node['apache']['locale']` - Locale to set in sysconfig or envvars and used for subprocesses and modules (like mod_dav and mod_wsgi). On debian systems Uses system-local if set to 'system', defaults to 'C'.
General settings General settings
---------------- ----------------
@ -173,16 +169,16 @@ These are general settings used in recipes and templates. Default
values are noted. values are noted.
* `node['apache']['version']` - Specifing 2.4 triggers apache 2.4 support. If the platform is known during our test to install 2.4 by default, it will be set to 2.4 for you. Otherwise it falls back to 2.2. This value should be specified as a string. * `node['apache']['version']` - Specifing 2.4 triggers apache 2.4 support. If the platform is known during our test to install 2.4 by default, it will be set to 2.4 for you. Otherwise it falls back to 2.2. This value should be specified as a string.
* `node['apache']['listen_addresses']` - Addresses that httpd should listen on. Default is any ("*"). * `node['apache']['listen']` - Array of address:port combinations that httpd should listen on. Default is any address and port 80 (`["*:80"]`).
* `node['apache']['listen_ports']` - Ports that httpd should listen on. Default is port 80.
* `node['apache']['contact']` - Value for ServerAdmin directive. Default "ops@example.com". * `node['apache']['contact']` - Value for ServerAdmin directive. Default "ops@example.com".
* `node['apache']['timeout']` - Value for the Timeout directive. Default is 300. * `node['apache']['timeout']` - Value for the Timeout directive. Default is 300.
* `node['apache']['keepalive']` - Value for the KeepAlive directive. Default is On. * `node['apache']['keepalive']` - Value for the KeepAlive directive. Default is On.
* `node['apache']['keepaliverequests']` - Value for MaxKeepAliveRequests. Default is 100. * `node['apache']['keepaliverequests']` - Value for MaxKeepAliveRequests. Default is 100.
* `node['apache']['keepalivetimeout']` - Value for the KeepAliveTimeout directive. Default is 5. * `node['apache']['keepalivetimeout']` - Value for the KeepAliveTimeout directive. Default is 5.
* `node['apache']['sysconfig_additional_params']` - Additionals variables set in sysconfig file. Default is empty. * `node['apache']['sysconfig_additional_params']` - Additionals variables set in sysconfig file. Default is empty.
* `node['apache']['log_level']` - Value for LogLevel directive. Default is 'warn'.
* `node['apache']['default_modules']` - Array of module names. Can take "mod_FOO" or "FOO" as names, where FOO is the apache module, e.g. "`mod_status`" or "`status`". * `node['apache']['default_modules']` - Array of module names. Can take "mod_FOO" or "FOO" as names, where FOO is the apache module, e.g. "`mod_status`" or "`status`".
* `node['apache']['mpm']` - With apache.version 2.4, specifies what Multi-Processing Module to enable. Default is "prefork". * `node['apache']['mpm']` - With apache.version 2.4, specifies what Multi-Processing Module to enable. Defaults to platform default, otherwise it is "prefork"
The modules listed in `default_modules` will be included as recipes in `recipe[apache::default]`. The modules listed in `default_modules` will be included as recipes in `recipe[apache::default]`.
@ -194,8 +190,8 @@ Prefork attributes are used for tuning the Apache HTTPD [prefork MPM](http://htt
* `node['apache']['prefork']['startservers']` - initial number of server processes to start. Default is 16. * `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. * `node['apache']['prefork']['minspareservers']` - minimum number of spare server processes. Default 16.
* `node['apache']['prefork']['maxspareservers']` - maximum number of spare server processes. Default 32. * `node['apache']['prefork']['maxspareservers']` - maximum number of spare server processes. Default 32.
* `node['apache']['prefork']['serverlimit']` - upper limit on configurable server processes. Default 400. * `node['apache']['prefork']['serverlimit']` - upper limit on configurable server processes. Default 256.
* `node['apache']['prefork']['maxrequestworkers']` - Maximum number of connections that will be processed simultaneously * `node['apache']['prefork']['maxrequestworkers']` - Maximum number of connections that will be processed simultaneously. Default 256.
* `node['apache']['prefork']['maxconnectionsperchild']` - Maximum number of request a child process will handle. Default 10000. * `node['apache']['prefork']['maxconnectionsperchild']` - Maximum number of request a child process will handle. Default 10000.
Worker attributes Worker attributes
@ -234,52 +230,12 @@ To use the cookbook with an unsupported mpm (other than prefork, event or worker
* set `node['apache']['mpm']` to the name of the module (e.g. `itk`) * set `node['apache']['mpm']` to the name of the module (e.g. `itk`)
* in your cookbook, after `include_recipe 'apache2'` use the `apache_module` definition to enable/disable the required module(s) * in your cookbook, after `include_recipe 'apache2'` use the `apache_module` definition to enable/disable the required module(s)
Module specific attributes
--------------------------
mod\_auth\_openid attributes Some module recipes have their own attributes that can be used to alter and modify the behavior of this cookbook. Please see the sections for the indivual modules below for more information on those 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.
* `node['apache']['mod_auth_openid']['checksum']` - sha256sum of the tarball containing the source.
* `node['apache']['mod_auth_openid']['ref']` - Any sha, tag, or branch found from https://github.com/bmuller/mod_auth_openid
* `node['apache']['mod_auth_openid']['version']` - directory name version within the tarball
* `node['apache']['mod_auth_openid']['cache_dir']` - the cache directory is where the sqlite3 database is stored. It is separate so it can be managed as a directory resource.
* `node['apache']['mod_auth_openid']['dblocation']` - filename of the sqlite3 database used for directive `AuthOpenIDDBLocation`, stored in the `cache_dir` by default.
* `node['apache']['mod_auth_openid']['configure_flags']` - optional array of configure flags passed to the `./configure` step in the compilation of the module.
mod\_ssl attributes
-------------------
For general information on this attributes see http://httpd.apache.org/docs/current/mod/mod_ssl.html
* `node['apache']['mod_ssl']['cipher_suite']` - sets the SSLCiphersuite value to the specified string. The default is
considered "sane" but you may need to change it for your local security policy, e.g. if you have PCI-DSS requirements. Additional
commentary on the
[original pull request](https://github.com/svanzoest-cookbooks/apache2/pull/15#commitcomment-1605406).
* `node['apache']['mod_ssl']['honor_cipher_order']` - Option to prefer the server's cipher preference order. Default 'On'.
* `node['apache']['mod_ssl']['insecure_renegotiation']` - Option to enable support for insecure renegotiation. Default 'Off'.
* `node['apache']['mod_ssl']['strict_sni_vhost_check']` - Whether to allow non-SNI clients to access a name-based virtual host. Default 'Off'.
* `node['apache']['mod_ssl']['session_cache']` - Configures the OCSP stapling cache. Default `shmcb:/var/run/apache2/ssl_scache`
* `node['apache']['mod_ssl']['session_cache_timeout']` - Number of seconds before an SSL session expires in the Session Cache. Default 300.
* `node['apache']['mod_ssl']['compression']` - Enable compression on the SSL level. Default 'Off'.
* `node['apache']['mod_ssl']['use_stapling']` - Enable stapling of OCSP responses in the TLS handshake. Default 'Off'.
* `node['apache']['mod_ssl']['stapling_responder_timeout']` - Timeout for OCSP stapling queries. Default 5
* `node['apache']['mod_ssl']['stapling_return_responder_errors']` - Pass stapling related OCSP errors on to client. Default 'Off'
* `node['apache']['mod_ssl']['stapling_cache']` - Configures the OCSP stapling cache. Default `shmcb:/var/run/ocsp(128000)`
* `node['apache']['mod_ssl']['pass_phrase_dialog']` - Configures SSLPassPhraseDialog. Default `builtin`
* `node['apache']['mod_ssl']['mutex']` - Configures SSLMutex. Default `file:/var/run/apache2/ssl_mutex`
* `node['apache']['mod_ssl']['directives']` - Hash for add any custom directive.
For more information on these directives and how to best secure your site see
- https://bettercrypto.org/
- https://wiki.mozilla.org/Security/Server_Side_TLS
- https://www.insecure.ws/linux/apache_ssl.html
- https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
- https://istlsfastyet.com/
- https://www.ssllabs.com/projects/best-practices/
Recipes Recipes
======= =======
@ -288,7 +244,7 @@ Most of the recipes in the cookbook are for enabling Apache modules.
Where additional configuration or behavior is used, it is documented Where additional configuration or behavior is used, it is documented
below in more detail. below in more detail.
The following recipes merely enable the specified module: `mod_alias`, The following recipes merely enable the specified module: `mod_actions`, `mod_alias`,
`mod_auth_basic`, `mod_auth_digest`, `mod_authn_file`, `mod_authnz_ldap`, `mod_auth_basic`, `mod_auth_digest`, `mod_authn_file`, `mod_authnz_ldap`,
`mod_authz_default`, `mod_authz_groupfile`, `mod_authz_host`, `mod_authz_default`, `mod_authz_groupfile`, `mod_authz_host`,
`mod_authz_user`, `mod_autoindex`, `mod_cgi`, `mod_dav_fs`, `mod_authz_user`, `mod_autoindex`, `mod_cgi`, `mod_dav_fs`,
@ -335,8 +291,6 @@ https://bugzilla.redhat.com/show_bug.cgi?format=multiple&id=708550
mod\_auth\_openid mod\_auth\_openid
----------------- -----------------
**Changed via COOK-915**
This recipe compiles the module from source. In addition to This recipe compiles the module from source. In addition to
`build-essential`, some other packages are included for installation `build-essential`, some other packages are included for installation
like the GNU C++ compiler and development headers. like the GNU C++ compiler and development headers.
@ -354,22 +308,23 @@ a different location than previous versions, see below. It should be a
sane default for most platforms, though, see sane default for most platforms, though, see
`attributes/mod_auth_openid.rb`. `attributes/mod_auth_openid.rb`.
### Changes from COOK-915: The following attributes are in the `attributes/mod_auth_openid.rb` file.
* `node['apache']['mod_auth_openid']['checksum']` - sha256sum of the tarball containing the source.
* `node['apache']['mod_auth_openid']['ref']` - Any sha, tag, or branch found from https://github.com/bmuller/mod_auth_openid
* `node['apache']['mod_auth_openid']['version']` - directory name version within the tarball
* `node['apache']['mod_auth_openid']['cache_dir']` - the cache directory is where the sqlite3 database is stored. It is separate so it can be managed as a directory resource.
* `node['apache']['mod_auth_openid']['dblocation']` - filename of the sqlite3 database used for directive `AuthOpenIDDBLocation`, stored in the `cache_dir` by default.
* `node['apache']['mod_auth_openid']['configure_flags']` - optional array of configure flags passed to the `./configure` step in the compilation of the module.
* `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.
mod\_fastcgi mod\_fastcgi
------------ ------------
Install the fastcgi package and enable the module. Install the fastcgi package and enable the module.
Only work on Debian/Ubuntu Note: In Ubuntu 14.04, the `libapache2-mod-fastcgi` module is not available by default due to the [Multiverse](https://help.ubuntu.com/community/Repositories/Ubuntu) repositories.
You need to enable the multiverse repositories either from `/etc/apt/sources.list` or use the [apt](https://supermarket.chef.io/cookbooks/apt) cookbook.
mod\_fcgid mod\_fcgid
---------- ----------
@ -377,12 +332,6 @@ mod\_fcgid
Installs the fcgi package and enables the module. Requires EPEL on Installs the fcgi package and enables the module. Requires EPEL on
RHEL family. 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:
[emerg] (2)No such file or directory: mod_fcgid: Can't create shared memory for size XX bytes
mod\_php5 mod\_php5
-------- --------
@ -399,56 +348,44 @@ mod\_ssl
-------- --------
Besides installing and enabling `mod_ssl`, this recipe will append Besides installing and enabling `mod_ssl`, this recipe will append
port 443 to the `node['apache']['listen_ports']` attribute array and port 443 to the `node['apache']['listen']` attributes for all addresses and
update the ports.conf. update the ports.conf.
* `node['apache']['mod_ssl']['cipher_suite']` - sets the SSLCiphersuite value to the specified string. The default is
considered "sane" but you may need to change it for your local security policy, e.g. if you have PCI-DSS requirements. Additional
commentary on the
[original pull request](https://github.com/sous-chefs/apache2/pull/15#commitcomment-1605406).
* `node['apache']['mod_ssl']['honor_cipher_order']` - Option to prefer the server's cipher preference order. Default 'On'.
* `node['apache']['mod_ssl']['insecure_renegotiation']` - Option to enable support for insecure renegotiation. Default 'Off'.
* `node['apache']['mod_ssl']['strict_sni_vhost_check']` - Whether to allow non-SNI clients to access a name-based virtual host. Default 'Off'.
* `node['apache']['mod_ssl']['session_cache']` - Configures the OCSP stapling cache. Default `shmcb:/var/run/apache2/ssl_scache`
* `node['apache']['mod_ssl']['session_cache_timeout']` - Number of seconds before an SSL session expires in the Session Cache. Default 300.
* `node['apache']['mod_ssl']['compression']` - Enable compression on the SSL level. Default 'Off'.
* `node['apache']['mod_ssl']['use_stapling']` - Enable stapling of OCSP responses in the TLS handshake. Default 'Off'.
* `node['apache']['mod_ssl']['stapling_responder_timeout']` - Timeout for OCSP stapling queries. Default 5
* `node['apache']['mod_ssl']['stapling_return_responder_errors']` - Pass stapling related OCSP errors on to client. Default 'Off'
* `node['apache']['mod_ssl']['stapling_cache']` - Configures the OCSP stapling cache. Default `shmcb:/var/run/ocsp(128000)`
* `node['apache']['mod_ssl']['pass_phrase_dialog']` - Configures SSLPassPhraseDialog. Default `builtin`
* `node['apache']['mod_ssl']['mutex']` - Configures SSLMutex. Default `file:/var/run/apache2/ssl_mutex`
* `node['apache']['mod_ssl']['directives']` - Hash for add any custom directive.
For general information on these attributes see http://httpd.apache.org/docs/current/mod/mod_ssl.html
For more information on these directives and how to best secure your site see
- https://bettercrypto.org/
- https://wiki.mozilla.org/Security/Server_Side_TLS
- https://www.insecure.ws/linux/apache_ssl.html
- https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
- https://istlsfastyet.com/
- https://www.ssllabs.com/projects/best-practices/
Definitions Definitions
=========== ===========
The cookbook provides a few definitions. At some point in the future The cookbook provides a few definitions. At some point in the future
these definitions may be refactored into lightweight resources and these definitions will be refactored into custom resources see
providers as suggested by [issue 414](https://github.com/sous-chefs/apache2/issues/414).
[foodcritic rule FC015](http://acrmp.github.com/foodcritic/#FC015).
apache\_config
------------
Sets up configuration file for Apache from a template. The
template should be in the same cookbook where the definition is used. This is used by the `apache_conf` definition and is not often used directly.
It will use `a2enconf` and `a2disconf` to control the symlinking of configuration files between `conf-available` and `conf-enabled`.
Enable or disable an Apache config file in
`#{node['apache']['dir']}/conf-available` by calling `a2enmod` or
`a2dismod` to manage the symbolic link in
`#{node['apache']['dir']}/conf-enabled`. These config files should be created in your cookbook, and placed on the system using `apache_conf`
### Parameters:
* `name` - Name of the config enabled or disabled with the `a2enconf` or `a2disconf` scripts.
* `source` - The location of a template file. The default `name.erb`.
* `cookbook` - The cookbook in which the configuration template is located (if it is not located in the current cookbook). The default value is the current cookbook.
* `enable` - Default true, which uses `a2enconf` to enable the config. If false, the config will be disabled with `a2disconf`.
### Examples:
Enable the example config.
``````
apache_config 'example' do
enable true
end
``````
Disable a module:
``````
apache_config 'disabled_example' do
enable false
end
``````
See the recipes directory for many more examples of `apache_config`.
apache\_conf apache\_conf
------------ ------------
@ -462,59 +399,77 @@ This definition should generally be called over `apache_config`.
* `name` - Name of the config placed and enabled or disabled with the `a2enconf` or `a2disconf` scripts. * `name` - Name of the config placed and enabled or disabled with the `a2enconf` or `a2disconf` scripts.
* `enable` - Default true, which uses `a2enconf` to enable the config. If false, the config will be disabled with `a2disconf`. * `enable` - Default true, which uses `a2enconf` to enable the config. If false, the config will be disabled with `a2disconf`.
* `conf_path` - path to put the config in if you need to override the default `conf-available`. * `conf_path` - path to put the config in if you need to override the default `conf-available`.
* `source` - The source configuration template name. The default value is `params[:name].conf.erb`
* `cookbook` - The cookbook in which the configuration template is located. The default value is the current cookbook.
### Examples: ### Examples:
Place and enable the example conf: Place and enable the example conf:
`````` ```ruby
apache_conf 'example' do apache_conf 'example' do
enable true enable true
end end
`````` ```
Place and disable (or never enable to begin with) the example conf: Place and disable (or never enable to begin with) the example conf:
`````` ```ruby
apache_conf 'example' do apache_conf 'example' do
enable false enable false
end end
`````` ```
Place the example conf, which has a different path than the default (conf-*): Place the example conf, which has a different path than the default (conf-*):
`````` ```ruby
apache_conf 'example' do apache_conf 'example' do
conf_path '/random/example/path' conf_path '/random/example/path'
enable false enable false
end end
`````` ```
apache\_mod
------------
Sets up configuration file for an Apache module from a template. The apache\_config (internal)
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 Sets up configuration file for Apache from a template. The
file in the `mods-available` under the Apache configuration directory template should be in the same cookbook where the definition is used. This is used by the `apache_conf` definition and should not be used directly.
(`node['apache']['dir']`). This is a platform-dependent location. See
__apache\_module__. It will use `a2enconf` and `a2disconf` to control the symlinking of configuration files between `conf-available` and `conf-enabled`.
Enable or disable an Apache config file in
`#{node['apache']['dir']}/conf-available` by calling `a2enconf` or
`a2disconf` to manage the symbolic link in
`#{node['apache']['dir']}/conf-enabled`. These config files should be created in your cookbook, and placed on the system using `apache_conf`
### Parameters: ### Parameters:
* `name` - Name of the template. When used from the `apache_module`, * `name` - Name of the config enabled or disabled with the `a2enconf` or `a2disconf` scripts.
it will use the same name as the module. * `source` - The location of a template file. The default `name.erb`.
* `cookbook` - The cookbook in which the configuration template is located (if it is not located in the current cookbook). The default value is the current cookbook.
* `enable` - Default true, which uses `a2enconf` to enable the config. If false, the config will be disabled with `a2disconf`.
### Examples: ### Examples:
Create `#{node['apache']['dir']}/mods-available/alias.conf`. Enable the example config.
```ruby
apache_config 'example' do
enable true
end
```
Disable a module:
```ruby
apache_config 'disabled_example' do
enable false
end
```
See the recipes directory for many more examples of `apache_config`.
``````
apache_mod "alias"
``````
apache\_module apache\_module
-------------- --------------
@ -538,30 +493,56 @@ the definition is used. See __Examples__.
Enable the ssl module, which also has a configuration template in `templates/default/mods/ssl.conf.erb`. Enable the ssl module, which also has a configuration template in `templates/default/mods/ssl.conf.erb`.
`````` ```ruby
apache_module "ssl" do apache_module "ssl" do
conf true conf true
end end
`````` ```
Enable the php5 module, which has a different filename than the module default: Enable the php5 module, which has a different filename than the module default:
`````` ```ruby
apache_module "php5" do apache_module "php5" do
filename "libphp5.so" filename "libphp5.so"
end end
`````` ```
Disable a module: Disable a module:
`````` ```ruby
apache_module "disabled_module" do apache_module "disabled_module" do
enable false enable false
end end
`````` ```
See the recipes directory for many more examples of `apache_module`. See the recipes directory for many more examples of `apache_module`.
apache\_mod (internal)
----------------------
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__.
### Parameters:
* `name` - Name of the template. When used from the `apache_module`,
it will use the same name as the module.
### Examples:
Create `#{node['apache']['dir']}/mods-available/alias.conf`.
```ruby
apache_mod "alias"
```
apache\_site apache\_site
------------ ------------
@ -619,12 +600,12 @@ The recommended way to use the `web_app` definition is in a application specific
The following example would look for a template named 'web_app.conf.erb' in your cookbook containing The following example would look for a template named 'web_app.conf.erb' in your cookbook containing
the apache httpd directives defining the `VirtualHost` that would serve up "my_app". the apache httpd directives defining the `VirtualHost` that would serve up "my_app".
`````` ```ruby
web_app "my_app" do web_app "my_app" do
template 'web_app.conf.erb' template 'web_app.conf.erb'
server_name node['my_app']['hostname'] server_name node['my_app']['hostname']
end end
`````` ```
All parameters are passed into the template. You can use whatever you 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 like. The apache2 cookbook comes with a `web_app.conf.erb` template as
@ -640,14 +621,14 @@ an example. The following parameters are used in the template:
To use the default web_app, for example: To use the default web_app, for example:
`````` ```ruby
web_app "my_site" do web_app "my_site" do
server_name node['hostname'] server_name node['hostname']
server_aliases [node['fqdn'], "my-site.example.com"] server_aliases [node['fqdn'], "my-site.example.com"]
docroot "/srv/www/my_site" docroot "/srv/www/my_site"
cookbook 'apache2' cookbook 'apache2'
end end
`````` ```
The parameters specified will be used as: The parameters specified will be used as:
@ -660,32 +641,15 @@ In the template. When you write your own, the `@` is significant.
For more information about Definitions and parameters, see the For more information about Definitions and parameters, see the
[Chef Wiki](http://docs.chef.io/definitions.html) [Chef Wiki](http://docs.chef.io/definitions.html)
Usage Tests
===== =====
Using this cookbook is relatively straightforward. Add the desired This cookbook in the [source repository](https://github.com/sous-chefs/apache2/)
recipes to the run list of a node, or create a role. Depending on your contains chefspec, serverspec tests.
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:
`````` Please see the CONTRIBUTING file for information on how to add tests
% cat roles/webserver.rb for your contributions.
name "webserver"
description "Systems that serve HTTP and HTTPS"
run_list(
"recipe[apache2]",
"recipe[apache2::mod_ssl]"
)
default_attributes(
"apache" => {
"listen_ports" => ["80", "443"]
}
)
``````
For examples of using the definitions in your own recipes, see their
respective sections above.
License and Authors License and Authors
=================== ===================
@ -706,13 +670,15 @@ License and Authors
* Author:: Gilles Devaux <gilles@peerpong.com> * Author:: Gilles Devaux <gilles@peerpong.com>
* Author:: Sander van Zoest <sander+cookbooks@vanzoest.com> * Author:: Sander van Zoest <sander+cookbooks@vanzoest.com>
* Author:: Taylor Price <tayworm@gmail.com> * Author:: Taylor Price <tayworm@gmail.com>
* Author:: Ben Dean <ben.dean@ontariosystems.com>
* Copyright:: 2009-2012, Chef Software, Inc * Copyright:: 2009-2012, Chef Software, Inc
* Copyright:: 2011, Atriso * Copyright:: 2011, Atriso
* Copyright:: 2011, CustomInk, LLC. * Copyright:: 2011, CustomInk, LLC.
* Copyright:: 2013-2014, OneHealth Solutions, Inc. * Copyright:: 2013-2014, OneHealth Solutions, Inc.
* Copyright:: 2014, Viverae, Inc. * Copyright:: 2014, Viverae, Inc.
* Copyright:: 2015, Alexander van Zoest * Copyright:: 2015-2016, Alexander van Zoest
* Copyright:: 2015, Ontario Systems, LLC
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@ -1,9 +1,9 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Attributes:: default # Attributes:: default
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# Copyright 2014, Viverae, Inc. # Copyright:: 2014, Viverae, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -37,6 +37,12 @@ default['apache']['mpm'] =
else else
'prefork' 'prefork'
end end
when 'suse'
'prefork'
when 'rhel'
'prefork'
when 'amazon'
'prefork'
else else
'prefork' 'prefork'
end end
@ -54,6 +60,8 @@ default['apache']['version'] =
else else
'2.4' '2.4'
end end
when 'amazon'
node['platform_version'].to_f >= 2013.09 ? '2.4' : '2.2'
when 'rhel' when 'rhel'
case node['platform'] case node['platform']
when 'amazon' when 'amazon'
@ -62,18 +70,15 @@ default['apache']['version'] =
node['platform_version'].to_f >= 7.0 ? '2.4' : '2.2' node['platform_version'].to_f >= 7.0 ? '2.4' : '2.2'
end end
when 'fedora' when 'fedora'
node['platform_version'].to_f >= 18 ? '2.4' : '2.2' '2.4'
when 'suse' when 'suse'
case node['platform'] case node['platform']
when 'opensuse' when 'suse'
node['platform_version'].to_f >= 13.1 ? '2.4' : '2.2' node['platform_version'].to_f >= 12.1 ? '2.4' : '2.2'
# FIXME: when "suse" for SLES
else else
'2.4' '2.4'
end end
when 'freebsd' when 'freebsd'
node['platform_version'].to_f >= 10.0 ? '2.4' : '2.2'
else
'2.4' '2.4'
end end
@ -83,9 +88,19 @@ default['apache']['default_site_name'] = 'default'
# Where the various parts of apache are # Where the various parts of apache are
case node['platform'] case node['platform']
when 'redhat', 'centos', 'scientific', 'fedora', 'amazon', 'oracle' when 'redhat', 'centos', 'scientific', 'fedora', 'amazon', 'oracle'
default['apache']['package'] = 'httpd' if node['platform'] == 'amazon'
if node['apache']['version'] == '2.4'
default['apache']['package'] = 'httpd24'
default['apache']['devel_package'] = 'httpd24-devel'
else
default['apache']['package'] = 'httpd22'
default['apache']['devel_package'] = 'httpd22-devel'
end
else
default['apache']['package'] = 'httpd'
default['apache']['devel_package'] = 'httpd-devel'
end
default['apache']['service_name'] = 'httpd' default['apache']['service_name'] = 'httpd'
default['apache']['devel_package'] = 'httpd-devel'
default['apache']['perl_pkg'] = 'perl' default['apache']['perl_pkg'] = 'perl'
default['apache']['apachectl'] = '/usr/sbin/apachectl' default['apache']['apachectl'] = '/usr/sbin/apachectl'
default['apache']['dir'] = '/etc/httpd' default['apache']['dir'] = '/etc/httpd'
@ -98,26 +113,24 @@ when 'redhat', 'centos', 'scientific', 'fedora', 'amazon', 'oracle'
default['apache']['conf_dir'] = '/etc/httpd/conf' default['apache']['conf_dir'] = '/etc/httpd/conf'
default['apache']['docroot_dir'] = '/var/www/html' default['apache']['docroot_dir'] = '/var/www/html'
default['apache']['cgibin_dir'] = '/var/www/cgi-bin' default['apache']['cgibin_dir'] = '/var/www/cgi-bin'
if node['apache']['version'] == '2.4' default['apache']['icondir'] =
default['apache']['icondir'] = '/usr/share/httpd/icons' if node['apache']['version'] == '2.4'
else '/usr/share/httpd/icons'
default['apache']['icondir'] = '/var/www/icons' else
end '/var/www/icons'
end
default['apache']['cache_dir'] = '/var/cache/httpd' default['apache']['cache_dir'] = '/var/cache/httpd'
default['apache']['run_dir'] = '/var/run/httpd' default['apache']['run_dir'] = '/var/run/httpd'
default['apache']['lock_dir'] = '/var/run/httpd' default['apache']['lock_dir'] = '/var/run/httpd'
if node['platform'] == 'amazon' && node['apache']['version'] == '2.4' default['apache']['pid_file'] =
default['apache']['package'] = 'httpd24' if node['platform_version'].to_f >= 6
default['apache']['devel_package'] = 'httpd24-devel' '/var/run/httpd/httpd.pid'
end else
if node['platform_version'].to_f >= 6 '/var/run/httpd.pid'
default['apache']['pid_file'] = '/var/run/httpd/httpd.pid' end
else default['apache']['lib_dir'] = node['kernel']['machine'] =~ /^i[36]86$/ ? '/usr/lib/httpd' : '/usr/lib64/httpd'
default['apache']['pid_file'] = '/var/run/httpd.pid' default['apache']['libexec_dir'] = "#{node['apache']['lib_dir']}/modules"
end when 'suse', 'opensuse', 'opensuseleap'
default['apache']['lib_dir'] = node['kernel']['machine'] =~ /^i[36]86$/ ? '/usr/lib/httpd' : '/usr/lib64/httpd'
default['apache']['libexec_dir'] = "#{node['apache']['lib_dir']}/modules"
when 'suse', 'opensuse'
default['apache']['package'] = 'apache2' default['apache']['package'] = 'apache2'
default['apache']['perl_pkg'] = 'perl' default['apache']['perl_pkg'] = 'perl'
default['apache']['devel_package'] = 'httpd-devel' default['apache']['devel_package'] = 'httpd-devel'
@ -136,21 +149,23 @@ when 'suse', 'opensuse'
default['apache']['cache_dir'] = '/var/cache/apache2' default['apache']['cache_dir'] = '/var/cache/apache2'
default['apache']['run_dir'] = '/var/run/httpd' default['apache']['run_dir'] = '/var/run/httpd'
default['apache']['lock_dir'] = '/var/run/httpd' default['apache']['lock_dir'] = '/var/run/httpd'
if node['platform_version'].to_f >= 6 default['apache']['pid_file'] =
default['apache']['pid_file'] = '/var/run/httpd/httpd.pid' if node['platform_version'].to_f > 11.4
else '/var/run/httpd.pid'
default['apache']['pid_file'] = '/var/run/httpd.pid' else
end '/var/run/httpd2.pid'
end
default['apache']['lib_dir'] = node['kernel']['machine'] =~ /^i[36]86$/ ? '/usr/lib/apache2' : '/usr/lib64/apache2' default['apache']['lib_dir'] = node['kernel']['machine'] =~ /^i[36]86$/ ? '/usr/lib/apache2' : '/usr/lib64/apache2'
default['apache']['libexec_dir'] = node['apache']['lib_dir'] default['apache']['libexec_dir'] = node['apache']['lib_dir']
when 'debian', 'ubuntu' when 'debian', 'ubuntu'
default['apache']['package'] = 'apache2' default['apache']['package'] = 'apache2'
default['apache']['perl_pkg'] = 'perl' default['apache']['perl_pkg'] = 'perl'
if node['apache']['mpm'] == 'prefork' default['apache']['devel_package'] =
default['apache']['devel_package'] = 'apache2-prefork-dev' if node['apache']['mpm'] == 'prefork'
else 'apache2-prefork-dev'
default['apache']['devel_package'] = 'apache2-dev' else
end 'apache2-dev'
end
default['apache']['apachectl'] = '/usr/sbin/apache2ctl' default['apache']['apachectl'] = '/usr/sbin/apache2ctl'
default['apache']['dir'] = '/etc/apache2' default['apache']['dir'] = '/etc/apache2'
default['apache']['log_dir'] = '/var/log/apache2' default['apache']['log_dir'] = '/var/log/apache2'
@ -178,7 +193,8 @@ when 'debian', 'ubuntu'
default['apache']['libexec_dir'] = "#{node['apache']['lib_dir']}/modules" default['apache']['libexec_dir'] = "#{node['apache']['lib_dir']}/modules"
default['apache']['default_site_name'] = '000-default' default['apache']['default_site_name'] = '000-default'
when 'arch' when 'arch'
default['apache']['package'] = 'apache' default['apache']['package'] = 'apache'
default['apache']['service_name'] = 'httpd'
default['apache']['perl_pkg'] = 'perl' default['apache']['perl_pkg'] = 'perl'
# default['apache']['apachectl'] = '/usr/sbin/apachectl' # default['apache']['apachectl'] = '/usr/sbin/apachectl'
default['apache']['dir'] = '/etc/httpd' default['apache']['dir'] = '/etc/httpd'
@ -197,31 +213,18 @@ when 'arch'
default['apache']['lock_dir'] = '/var/run/httpd' default['apache']['lock_dir'] = '/var/run/httpd'
default['apache']['pid_file'] = '/var/run/httpd/httpd.pid' default['apache']['pid_file'] = '/var/run/httpd/httpd.pid'
default['apache']['lib_dir'] = '/usr/lib/httpd' default['apache']['lib_dir'] = '/usr/lib/httpd'
default['apache']['libexec_dir'] = "#{node['apache']['lib_dir']}/modules" default['apache']['libexec_dir'] = "#{node['apache']['lib_dir']}/modules"
when 'freebsd' when 'freebsd'
if node['apache']['version'] == '2.4' default['apache']['package'] = 'apache24'
default['apache']['package'] = 'apache24' default['apache']['dir'] = '/usr/local/etc/apache24'
default['apache']['dir'] = '/usr/local/etc/apache24' default['apache']['conf_dir'] = '/usr/local/etc/apache24'
default['apache']['conf_dir'] = '/usr/local/etc/apache24' default['apache']['docroot_dir'] = '/usr/local/www/apache24/data'
default['apache']['docroot_dir'] = '/usr/local/www/apache24/data' default['apache']['cgibin_dir'] = '/usr/local/www/apache24/cgi-bin'
default['apache']['cgibin_dir'] = '/usr/local/www/apache24/cgi-bin' default['apache']['icondir'] = '/usr/local/www/apache24/icons'
default['apache']['icondir'] = '/usr/local/www/apache24/icons' default['apache']['cache_dir'] = '/var/cache/apache24'
default['apache']['cache_dir'] = '/var/cache/apache24' default['apache']['run_dir'] = '/var/run'
default['apache']['run_dir'] = '/var/run' default['apache']['lock_dir'] = '/var/run'
default['apache']['lock_dir'] = '/var/run' default['apache']['lib_dir'] = '/usr/local/libexec/apache24'
default['apache']['lib_dir'] = '/usr/local/libexec/apache24'
else
default['apache']['package'] = 'apache22'
default['apache']['dir'] = '/usr/local/etc/apache22'
default['apache']['conf_dir'] = '/usr/local/etc/apache22'
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/cache/apache22'
default['apache']['run_dir'] = '/var/run'
default['apache']['lock_dir'] = '/var/run'
default['apache']['lib_dir'] = '/usr/local/libexec/apache22'
end
default['apache']['devel_package'] = 'httpd-devel' default['apache']['devel_package'] = 'httpd-devel'
default['apache']['perl_pkg'] = 'perl5' default['apache']['perl_pkg'] = 'perl5'
default['apache']['apachectl'] = '/usr/local/sbin/apachectl' default['apache']['apachectl'] = '/usr/local/sbin/apachectl'
@ -233,9 +236,9 @@ when 'freebsd'
default['apache']['user'] = 'www' default['apache']['user'] = 'www'
default['apache']['group'] = 'www' default['apache']['group'] = 'www'
default['apache']['binary'] = '/usr/local/sbin/httpd' default['apache']['binary'] = '/usr/local/sbin/httpd'
default['apache']['libexec_dir'] = node['apache']['lib_dir'] default['apache']['libexec_dir'] = node['apache']['lib_dir']
else else
default['apache']['package'] = 'apache2' default['apache']['package'] = 'apache2'
default['apache']['devel_package'] = 'apache2-dev' default['apache']['devel_package'] = 'apache2-dev'
default['apache']['perl_pkg'] = 'perl' default['apache']['perl_pkg'] = 'perl'
default['apache']['dir'] = '/etc/apache2' default['apache']['dir'] = '/etc/apache2'
@ -266,8 +269,7 @@ end
if node['apache']['service_name'].nil? if node['apache']['service_name'].nil?
default['apache']['service_name'] = node['apache']['package'] default['apache']['service_name'] = node['apache']['package']
end end
default['apache']['listen_addresses'] = %w(*) default['apache']['listen'] = ['*:80']
default['apache']['listen_ports'] = %w(80)
default['apache']['contact'] = 'ops@example.com' default['apache']['contact'] = 'ops@example.com'
default['apache']['timeout'] = 300 default['apache']['timeout'] = 300
default['apache']['keepalive'] = 'On' default['apache']['keepalive'] = 'On'
@ -278,15 +280,14 @@ default['apache']['sysconfig_additional_params'] = {}
default['apache']['default_site_enabled'] = false default['apache']['default_site_enabled'] = false
default['apache']['default_site_port'] = '80' default['apache']['default_site_port'] = '80'
default['apache']['access_file_name'] = '.htaccess' default['apache']['access_file_name'] = '.htaccess'
default['apache']['default_release'] = nil
default['apache']['log_level'] = 'warn'
# Security # Security
default['apache']['servertokens'] = 'Prod' default['apache']['servertokens'] = 'Prod'
default['apache']['serversignature'] = 'On' default['apache']['serversignature'] = 'On'
default['apache']['traceenable'] = 'Off' default['apache']['traceenable'] = 'Off'
# mod_auth_openids
default['apache']['allowed_openids'] = []
# mod_status Allow list, space seprated list of allowed entries. # mod_status Allow list, space seprated list of allowed entries.
default['apache']['status_allow_list'] = '127.0.0.1 ::1' default['apache']['status_allow_list'] = '127.0.0.1 ::1'
@ -336,19 +337,19 @@ default['apache']['proxy']['allow_from'] = 'none'
# Default modules to enable via include_recipe # Default modules to enable via include_recipe
default['apache']['default_modules'] = %w( default['apache']['default_modules'] = %w(
status alias auth_basic authn_core authn_file authz_core authz_groupfile status alias auth_basic authn_core authn_file authz_core authz_groupfile
authz_host authz_user autoindex dir env mime negotiation setenvif authz_host authz_user autoindex deflate dir env mime negotiation setenvif
) )
%w(log_config logio).each do |log_mod| %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']) default['apache']['default_modules'] << log_mod if %w(rhel amazon fedora suse arch freebsd).include?(node['platform_family'])
end end
if node['apache']['version'] == '2.4' if node['apache']['version'] == '2.4'
%w(unixd).each do |unix_mod| %w(unixd).each do |unix_mod|
default['apache']['default_modules'] << unix_mod if %w(rhel fedora suse arch freebsd).include?(node['platform_family']) default['apache']['default_modules'] << unix_mod if %w(rhel amazon fedora suse arch freebsd).include?(node['platform_family'])
end end
unless node['platform'] == 'amazon' unless node['platform'] == 'amazon'
default['apache']['default_modules'] << 'systemd' if %w(rhel fedora).include?(node['platform_family']) default['apache']['default_modules'] << 'systemd' if %w(rhel fedora amazon).include?(node['platform_family'])
end end
end end

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Attributes:: mod_auth_cas # Attributes:: mod_auth_cas
# #
# Copyright 2013, Chef Software, Inc. # Copyright:: 2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -18,4 +18,4 @@
# #
default['apache']['mod_auth_cas']['from_source'] = false default['apache']['mod_auth_cas']['from_source'] = false
default['apache']['mod_auth_cas']['source_revision'] = 'v1.0.8.1' default['apache']['mod_auth_cas']['source_revision'] = 'v1.0.9.1'

View File

@ -1,8 +1,9 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Attributes:: mod_auth_cas # Attributes:: mod_auth_openid
# #
# Copyright 2013, Chef Software, Inc. # Copyright:: 2013, Chef Software, Inc.
# Copyright:: 2014-2016, Alexander van Zoest
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -17,18 +18,21 @@
# limitations under the License. # limitations under the License.
# #
# mod_auth_openids
default['apache']['allowed_openids'] = []
default['apache']['mod_auth_openid']['ref'] = 'v0.8' default['apache']['mod_auth_openid']['ref'] = 'v0.8'
default['apache']['mod_auth_openid']['version'] = '0.8' default['apache']['mod_auth_openid']['version'] = '0.8'
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']['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" default['apache']['mod_auth_openid']['dblocation'] = "#{node['apache']['mod_auth_openid']['cache_dir']}/mod_auth_openid.db"
case node['platform_family'] default['apache']['mod_auth_openid']['configure_flags'] =
when 'freebsd' case node['platform_family']
default['apache']['mod_auth_openid']['configure_flags'] = [ when 'freebsd'
'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'] = [] else
end []
end

View File

@ -1,8 +1,9 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Attributes:: mod_fastcgi # Attributes:: mod_fastcgi
# #
# Copyright 2013, Chef Software, Inc. # Copyright:: 2013, Chef Software, Inc.
# Copyright:: 2016, Alexander van Zoest
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -19,3 +20,20 @@
default['apache']['mod_fastcgi']['download_url'] = 'http://www.fastcgi.com/dist/mod_fastcgi-current.tar.gz' default['apache']['mod_fastcgi']['download_url'] = 'http://www.fastcgi.com/dist/mod_fastcgi-current.tar.gz'
default['apache']['mod_fastcgi']['install_method'] = 'package' default['apache']['mod_fastcgi']['install_method'] = 'package'
default['apache']['mod_fastcgi']['package'] =
case node['platform_family']
when 'debian'
'libapache2-mod-fastcgi'
when 'amazon'
'mod_fastcgi'
when 'rhel'
'mod_fastcgi'
when 'freebsd'
if node['apache']['version'] == '2.4'
'ap24-mod_fastcgi'
else
'ap22-mod_fastcgi'
end
else
'mod_fastcgi'
end

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Attributes:: mod_pagespeed # Attributes:: mod_pagespeed
# #
# Copyright 2013, ZOZI # Copyright:: 2013, ZOZI
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -0,0 +1,34 @@
#
# Cookbook:: apache2
# Attributes:: mod_php5
#
# Copyright:: 2014, Viverae, 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_php']['install_method'] = 'package'
default['apache']['mod_php']['module_name'] = 'php5'
default['apache']['mod_php']['so_filename'] = 'libphp5.so'
default['apache']['mod_php']['so_filename'] = 'mod_php5.so' if node['platform_family'] == 'suse'
if node['platform'] == 'ubuntu' && node['platform_version'].to_f >= 16.04
default['apache']['mod_php']['module_name'] = 'php7'
default['apache']['mod_php']['so_filename'] = 'libphp7.0.so'
end
if node['platform'] == 'debian' && node['platform_version'].to_f >= 9
default['apache']['mod_php']['module_name'] = 'php7'
default['apache']['mod_php']['so_filename'] = 'libphp7.0.so'
end
if node['platform'] == 'amazon' && node['apache']['version'] == '2.4'
default['apache']['mod_php']['so_filename'] = 'libphp.so'
end

View File

@ -1,9 +1,9 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Attributes:: mod_ssl # Attributes:: mod_ssl
# #
# Copyright 2012-2013, Chef Software, Inc. # Copyright:: 2012-2013, Chef Software, Inc.
# Copyright 2014, Viverae, Inc. # Copyright:: 2014, Viverae, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -20,12 +20,12 @@
default['apache']['mod_ssl']['port'] = 443 default['apache']['mod_ssl']['port'] = 443
default['apache']['mod_ssl']['protocol'] = 'All -SSLv2 -SSLv3' default['apache']['mod_ssl']['protocol'] = 'All -SSLv2 -SSLv3'
default['apache']['mod_ssl']['cipher_suite'] = 'EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH+aRSA+RC4:EECDH:EDH+aRSA:RC4!aNULL!eNULL!LOW!3DES!MD5!EXP!PSK!SRP!DSS' default['apache']['mod_ssl']['cipher_suite'] = 'EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA256:EECDH:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!RC4:!SEED:!IDEA:!ECDSA:kEDH:CAMELLIA128-SHA:AES128-SHA'
default['apache']['mod_ssl']['honor_cipher_order'] = 'On' default['apache']['mod_ssl']['honor_cipher_order'] = 'On'
default['apache']['mod_ssl']['insecure_renegotiation'] = 'Off' default['apache']['mod_ssl']['insecure_renegotiation'] = 'Off'
default['apache']['mod_ssl']['strict_sni_vhost_check'] = 'Off' default['apache']['mod_ssl']['strict_sni_vhost_check'] = 'Off'
default['apache']['mod_ssl']['session_cache'] = 'shmcb:/var/run/apache2/ssl_scache' default['apache']['mod_ssl']['session_cache'] = 'shmcb:/var/run/apache2/ssl_scache'
default['apache']['mod_ssl']['session_cache_timeout'] = 300 default['apache']['mod_ssl']['session_cache_timeout'] = 300
default['apache']['mod_ssl']['compression'] = 'Off' default['apache']['mod_ssl']['compression'] = 'Off'
default['apache']['mod_ssl']['use_stapling'] = 'Off' default['apache']['mod_ssl']['use_stapling'] = 'Off'
default['apache']['mod_ssl']['stapling_responder_timeout'] = 5 default['apache']['mod_ssl']['stapling_responder_timeout'] = 5
@ -45,8 +45,12 @@ when 'debian'
end end
end end
when 'freebsd' when 'freebsd'
default['apache']['mod_ssl']['session_cache'] = 'shmcb:/var/run/ssl_scache(512000)' default['apache']['mod_ssl']['session_cache'] = 'shmcb:/var/run/ssl_scache(512000)'
default['apache']['mod_ssl']['mutex'] = 'file:/var/run/ssl_mutex' default['apache']['mod_ssl']['mutex'] = 'file:/var/run/ssl_mutex'
when 'amazon'
if node['apache']['version'] == '2.4'
default['apache']['mod_ssl']['pkg_name'] = 'mod24_ssl'
end
when 'rhel', 'fedora', 'suse' when 'rhel', 'fedora', 'suse'
case node['platform'] case node['platform']
when 'amazon' when 'amazon'
@ -54,6 +58,6 @@ when 'rhel', 'fedora', 'suse'
default['apache']['mod_ssl']['pkg_name'] = 'mod24_ssl' default['apache']['mod_ssl']['pkg_name'] = 'mod24_ssl'
end end
end end
default['apache']['mod_ssl']['session_cache'] = 'shmcb:/var/cache/mod_ssl/scache(512000)' default['apache']['mod_ssl']['session_cache'] = 'shmcb:/var/cache/mod_ssl/scache(512000)'
default['apache']['mod_ssl']['mutex'] = 'default' default['apache']['mod_ssl']['mutex'] = 'default'
end end

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Definition:: apache_conf # Definition:: apache_conf
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -17,7 +17,7 @@
# limitations under the License. # limitations under the License.
# #
define :apache_conf, :enable => true do define :apache_conf, enable: true do
include_recipe 'apache2::default' include_recipe 'apache2::default'
conf_name = "#{params[:name]}.conf" conf_name = "#{params[:name]}.conf"
@ -34,7 +34,7 @@ define :apache_conf, :enable => true do
group node['apache']['root_group'] group node['apache']['root_group']
backup false backup false
mode '0644' mode '0644'
notifies :reload, 'service[apache2]', :delayed notifies :restart, 'service[apache2]', :delayed
end end
if params[:enable] if params[:enable]

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Definition:: apache_config # Definition:: apache_config
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -17,7 +17,7 @@
# limitations under the License. # limitations under the License.
# #
define :apache_config, :enable => true do define :apache_config, enable: true do
include_recipe 'apache2::default' include_recipe 'apache2::default'
conf_name = "#{params[:name]}.conf" conf_name = "#{params[:name]}.conf"
@ -26,7 +26,7 @@ define :apache_config, :enable => true do
if params[:enable] if params[:enable]
execute "a2enconf #{conf_name}" do execute "a2enconf #{conf_name}" do
command "/usr/sbin/a2enconf #{conf_name}" command "/usr/sbin/a2enconf #{conf_name}"
notifies :reload, 'service[apache2]', :delayed notifies :restart, 'service[apache2]', :delayed
not_if do not_if do
::File.symlink?("#{node['apache']['dir']}/conf-enabled/#{conf_name}") && ::File.symlink?("#{node['apache']['dir']}/conf-enabled/#{conf_name}") &&
(::File.exist?(params[:conf_path]) ? ::File.symlink?("#{node['apache']['dir']}/conf-enabled/#{conf_name}") : true) (::File.exist?(params[:conf_path]) ? ::File.symlink?("#{node['apache']['dir']}/conf-enabled/#{conf_name}") : true)

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Definition:: apache_mod # Definition:: apache_mod
# #
# Copyright 2008-20013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Definition:: apache_module # Definition:: apache_module
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -17,7 +17,7 @@
# limitations under the License. # limitations under the License.
# #
define :apache_module, :enable => true, :conf => false, :restart => false do define :apache_module, enable: true, conf: false, restart: false do
include_recipe 'apache2::default' include_recipe 'apache2::default'
params[:filename] = params[:filename] || "mod_#{params[:name]}.so" params[:filename] = params[:filename] || "mod_#{params[:name]}.so"

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Definition:: apache_site # Definition:: apache_site
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -17,7 +17,7 @@
# limitations under the License. # limitations under the License.
# #
define :apache_site, :enable => true do define :apache_site, enable: true do
include_recipe 'apache2::default' include_recipe 'apache2::default'
conf_name = "#{params[:name]}.conf" conf_name = "#{params[:name]}.conf"

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Definition:: web_app # Definition:: web_app
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -17,7 +17,7 @@
# limitations under the License. # limitations under the License.
# #
define :web_app, :template => 'web_app.conf.erb', :local => false, :enable => true do define :web_app, template: 'web_app.conf.erb', local: false, enable: true, server_port: 80 do
application_name = params[:name] application_name = params[:name]
include_recipe 'apache2::default' include_recipe 'apache2::default'
@ -33,8 +33,8 @@ define :web_app, :template => 'web_app.conf.erb', :local => false, :enable => tr
mode '0644' mode '0644'
cookbook params[:cookbook] if params[:cookbook] cookbook params[:cookbook] if params[:cookbook]
variables( variables(
:application_name => application_name, application_name: application_name,
:params => params params: params
) )
if ::File.exist?("#{node['apache']['dir']}/sites-enabled/#{application_name}.conf") if ::File.exist?("#{node['apache']['dir']}/sites-enabled/#{application_name}.conf")
notifies :reload, 'service[apache2]', :delayed notifies :reload, 'service[apache2]', :delayed

View File

@ -0,0 +1,45 @@
# encoding: utf-8
#
# Cookbook:: apache2
# Libraries:: listen
#
# Copyright:: 2015, Ontario Systems, LLC
#
# 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.
#
module Apache2
# Provides method to convert node['apache']['listen_ports'] and node['apache']['listen_addresses'] into new node['apache']['listen']
module Listen
# @param node [Chef::Node] the chef node
# @return [Hash] a hash indexed by address where the values are arrays of ports to listen to
def merge_listen_attributes(node)
(Apache2::Listen.converted_listen_ports_and_addresses(node) + node['apache']['listen']).uniq
end
module_function :merge_listen_attributes
private_class_method
def self.converted_listen_ports_and_addresses(node)
return [] unless node['apache']['listen_ports'] || node['apache']['listen_addresses']
Chef::Log.warn "node['apache']['listen_ports'] and node['apache']['listen_addresses'] are deprecated in favor of node['apache']['listen']. Please adjust your cookbooks"
# Defaults to * for addresses or 80 / 443 for ports if not specified
(node['apache']['listen_addresses'] || %w(*)).uniq.each_with_object([]) do |address, listen|
(node['apache']['listen_ports'] || %w(80 443)).uniq.each do |port|
listen << "#{address}:#{port}"
end
end
end
end
end

File diff suppressed because one or more lines are too long

View File

@ -1,9 +1,9 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: default # Recipe:: default
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# Copyright 2014-2015, Alexander van Zoest # Copyright:: 2014-2015, Alexander van Zoest
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -18,8 +18,9 @@
# limitations under the License. # limitations under the License.
# #
package 'apache2' do package 'apache2' do # ~FC009 only available in apt_package. See #388
package_name node['apache']['package'] package_name node['apache']['package']
default_release node['apache']['default_release'] unless node['apache']['default_release'].nil?
end end
%w(sites-available sites-enabled mods-available mods-enabled conf-available conf-enabled).each do |dir| %w(sites-available sites-enabled mods-available mods-enabled conf-available conf-enabled).each do |dir|
@ -43,18 +44,16 @@ end
end end
end end
directory "#{node['apache']['dir']}/conf.d" do
action :delete
recursive true
end
directory node['apache']['log_dir'] do directory node['apache']['log_dir'] do
mode '0755' mode '0755'
recursive true
end end
# perl is needed for the a2* scripts # perl is needed for the a2* scripts
package node['apache']['perl_pkg'] package node['apache']['perl_pkg']
package 'perl-Getopt-Long-Descriptive' if platform?('fedora')
%w(a2ensite a2dissite a2enmod a2dismod a2enconf a2disconf).each do |modscript| %w(a2ensite a2dissite a2enmod a2dismod a2enconf a2disconf).each do |modscript|
link "/usr/sbin/#{modscript}" do link "/usr/sbin/#{modscript}" do
action :delete action :delete
@ -82,9 +81,6 @@ unless platform_family?('debian')
command "/usr/local/bin/apache2_module_conf_generate.pl #{node['apache']['lib_dir']} #{node['apache']['dir']}/mods-available" command "/usr/local/bin/apache2_module_conf_generate.pl #{node['apache']['lib_dir']} #{node['apache']['dir']}/mods-available"
action :nothing action :nothing
end end
# enable mod_deflate for consistency across distributions
include_recipe 'apache2::mod_deflate'
end end
if platform_family?('freebsd') if platform_family?('freebsd')
@ -128,7 +124,7 @@ end
directory node['apache']['lock_dir'] do directory node['apache']['lock_dir'] do
mode '0755' mode '0755'
if node['platform_family'] == 'debian' && node['apache']['version'] == '2.2' if node['platform_family'] == 'debian'
owner node['apache']['user'] owner node['apache']['user']
else else
owner 'root' owner 'root'
@ -143,7 +139,7 @@ template "/etc/sysconfig/#{node['apache']['package']}" do
group node['apache']['root_group'] group node['apache']['root_group']
mode '0644' mode '0644'
notifies :restart, 'service[apache2]', :delayed notifies :restart, 'service[apache2]', :delayed
only_if { platform_family?('rhel', 'fedora', 'suse') } only_if { platform_family?('rhel', 'amazon', 'fedora', 'suse') }
end end
template "#{node['apache']['dir']}/envvars" do template "#{node['apache']['dir']}/envvars" do
@ -156,7 +152,7 @@ template "#{node['apache']['dir']}/envvars" do
end end
template 'apache2.conf' do template 'apache2.conf' do
if platform_family?('rhel', 'fedora', 'arch', 'freebsd') if platform_family?('rhel', 'amazon', 'fedora', 'arch', 'freebsd')
path "#{node['apache']['conf_dir']}/httpd.conf" path "#{node['apache']['conf_dir']}/httpd.conf"
elsif platform_family?('debian') elsif platform_family?('debian')
path "#{node['apache']['conf_dir']}/apache2.conf" path "#{node['apache']['conf_dir']}/apache2.conf"
@ -182,8 +178,7 @@ apache_conf 'ports' do
conf_path node['apache']['dir'] conf_path node['apache']['dir']
end end
if node['apache']['version'] == '2.4' && !platform_family?('freebsd') if node['apache']['version'] == '2.4'
# on freebsd the prefork mpm is staticly compiled in
if node['apache']['mpm_support'].include?(node['apache']['mpm']) if node['apache']['mpm_support'].include?(node['apache']['mpm'])
include_recipe "apache2::mpm_#{node['apache']['mpm']}" include_recipe "apache2::mpm_#{node['apache']['mpm']}"
else else
@ -203,18 +198,22 @@ if node['apache']['default_site_enabled']
end end
end end
apache_service_name = node['apache']['service_name']
service 'apache2' do service 'apache2' do
service_name node['apache']['service_name'] service_name apache_service_name
case node['platform_family'] case node['platform_family']
when 'rhel' when 'rhel'
restart_command '/sbin/service httpd restart && sleep 1' if node['apache']['version'] == '2.2' if node['platform_version'].to_f < 7.0 && node['apache']['version'] != '2.4'
reload_command '/sbin/service httpd graceful' restart_command "/sbin/service #{apache_service_name} restart && sleep 1"
reload_command "/sbin/service #{apache_service_name} graceful && sleep 1"
end
when 'debian' when 'debian'
provider Chef::Provider::Service::Debian provider Chef::Provider::Service::Debian
when 'arch' when 'arch'
service_name 'httpd' service_name apache_service_name
end end
supports [:start, :restart, :reload, :status] supports [:start, :restart, :reload, :status]
action [:enable, :start] action [:enable, :start]
only_if "#{node['apache']['binary']} -t", :environment => { 'APACHE_LOG_DIR' => node['apache']['log_dir'] }, :timeout => 10 only_if "#{node['apache']['binary']} -t", environment: { 'APACHE_LOG_DIR' => node['apache']['log_dir'] }, timeout: 10
end end

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_access_compat # Recipe:: mod_access_compat
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_actions # Recipe:: mod_actions
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_alias # Recipe:: mod_alias
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_allowmethods # Recipe:: mod_allowmethods
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,10 +1,10 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: apreq2 # Recipe:: apreq2
# #
# modified from the python recipe by Jeremy Bingham # modified from the python recipe by Jeremy Bingham
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -28,7 +28,7 @@ when 'suse'
package 'apache2-mod_apreq2' do package 'apache2-mod_apreq2' do
notifies :run, 'execute[generate-module-list]', :immediately notifies :run, 'execute[generate-module-list]', :immediately
end end
when 'rhel', 'fedora' when 'rhel', 'fedora', 'amazon'
package 'libapreq2' do package 'libapreq2' do
notifies :run, 'execute[generate-module-list]', :immediately notifies :run, 'execute[generate-module-list]', :immediately
end end
@ -43,8 +43,8 @@ when 'rhel', 'fedora'
end end
file "#{node['apache']['dir']}/conf.d/apreq.conf" do file "#{node['apache']['dir']}/conf.d/apreq.conf" do
action :delete content '# conf is under mods-available/apreq.conf - apache2 cookbook\n'
backup false only_if { ::Dir.exist?("#{node['apache']['dir']}/conf.d") }
end end
apache_module 'apreq' apache_module 'apreq'

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_asis # Recipe:: mod_asis
# #
# Copyright 2008-2009, Chef Software, Inc. # Copyright:: 2008-2009, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_auth_basic # Recipe:: mod_auth_basic
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_auth_cas # Recipe:: mod_auth_cas
# #
# Copyright 2013, Chef Software, Inc. # Copyright:: 2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -45,14 +45,14 @@ else
when 'debian' when 'debian'
package 'libapache2-mod-auth-cas' package 'libapache2-mod-auth-cas'
when 'rhel', 'fedora' when 'rhel', 'fedora', 'amazon'
yum_package 'mod_auth_cas' do yum_package 'mod_auth_cas' do
notifies :run, 'execute[generate-module-list]', :immediately notifies :run, 'execute[generate-module-list]', :immediately
end end
file "#{node['apache']['dir']}/conf.d/auth_cas.conf" do file "#{node['apache']['dir']}/conf.d/auth_cas.conf" do
action :delete content '# conf is under mods-available/auth_cas.conf - apache2 cookbook\n'
backup false only_if { ::Dir.exist?("#{node['apache']['dir']}/conf.d") }
end end
end end
end end

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_auth_digest # Recipe:: mod_auth_digest
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_auth_form # Recipe:: mod_auth_form
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_auth_openid # Recipe:: mod_auth_openid
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -20,7 +20,7 @@
openid_dev_pkgs = value_for_platform_family( openid_dev_pkgs = value_for_platform_family(
'debian' => %W(automake make g++ #{node['apache']['devel_package']} libopkele-dev libopkele3 libtool), 'debian' => %W(automake make g++ #{node['apache']['devel_package']} libopkele-dev libopkele3 libtool),
'suse' => %W(automake make g++ #{node['apache']['devel_package']} libopkele-dev libopkele3 libtool), 'suse' => %W(automake make g++ #{node['apache']['devel_package']} libopkele-dev libopkele3 libtool),
%w(rhel fedora) => %W(gcc-c++ #{node['apache']['devel_package']} curl-devel libtidy libtidy-devel sqlite-devel pcre-devel openssl-devel make libtool), %w(rhel fedora amazon) => %W(gcc-c++ #{node['apache']['devel_package']} curl-devel libtidy libtidy-devel sqlite-devel pcre-devel openssl-devel make libtool),
'arch' => %w(libopkele), 'arch' => %w(libopkele),
'freebsd' => %w(libopkele pcre sqlite3) 'freebsd' => %w(libopkele pcre sqlite3)
) )
@ -44,7 +44,7 @@ else
end end
case node['platform_family'] case node['platform_family']
when 'rhel', 'fedora' when 'rhel', 'fedora', 'amazon'
remote_file "#{Chef::Config['file_cache_path']}/libopkele-2.0.4.tar.gz" do remote_file "#{Chef::Config['file_cache_path']}/libopkele-2.0.4.tar.gz" do
source 'http://kin.klever.net/dist/libopkele-2.0.4.tar.gz' source 'http://kin.klever.net/dist/libopkele-2.0.4.tar.gz'
mode '0644' mode '0644'

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_authn_anon # Recipe:: mod_authn_anon
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_authn_core # Recipe:: mod_authn_core
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_authn_dbd # Recipe:: mod_authn_dbd
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_authn_dbm # Recipe:: mod_authn_dbm
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_authn_file # Recipe:: mod_authn_file
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_authn_socache # Recipe:: mod_authn_socache
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,9 +1,8 @@
# #
# Author:: Seth Chisamore (<schisamo@chef.io>) # Cookbook:: apache2
# Cookbook Name:: chef_handler # Recipe:: mod_authnz_fcgi
# Attributes:: default
# #
# Copyright 2011-2016, Chef Software, Inc # Copyright:: 2016, Alexander van Zoest
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -18,4 +17,4 @@
# limitations under the License. # limitations under the License.
# #
default['chef_handler']['handler_path'] = "#{File.expand_path(File.join(Chef::Config[:file_cache_path], '..'))}/handlers" apache_module 'authnz_fcgi'

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_authnz_ldap # Recipe:: mod_authnz_ldap
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_authz_core # Recipe:: mod_authz_core
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_authz_dbd # Recipe:: mod_authz_dbd
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_authz_dbm # Recipe:: mod_authz_dbm
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_authz_default # Recipe:: mod_authz_default
# #
# Copyright 2013, Chef Software, Inc. # Copyright:: 2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_authz_groupfile # Recipe:: mod_authz_groupfile
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_authz_host # Recipe:: mod_authz_host
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_authz_owner # Recipe:: mod_authz_owner
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_authz_user # Recipe:: mod_authz_user
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_autoindex # Recipe:: mod_autoindex
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_buffer # Recipe:: mod_buffer
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_cache # Recipe:: mod_cache
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_cache_disk # Recipe:: mod_cache_disk
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_cache_socache # Recipe:: mod_cache_socache
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Attributes:: mod_php5 # Recipe:: mod_cern_meta
# #
# Copyright 2014, Viverae, Inc. # Copyright:: 2016, Alexander van Zoest
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -15,10 +15,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
#
default['apache']['mod_php5']['install_method'] = 'package' apache_module 'cern_meta'
default['apache']['mod_php5']['so_filename'] = 'libphp5.so'
if node['platform'] == 'amazon' && node['apache']['version'] == '2.4'
default['apache']['mod_php5']['so_filename'] = 'libphp.so'
end

View File

@ -1,9 +1,9 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_cgi # Recipe:: mod_cgi
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# Copyright 2014, Viverae, Inc. # Copyright:: 2014, Viverae, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,9 +1,9 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_cgid # Recipe:: mod_cgid
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# Copyright 2014, Viverae, Inc. # Copyright:: 2014, Viverae, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_charset_lite # Recipe:: mod_charset_lite
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_cloudflare # Recipe:: mod_cloudflare
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_data # Recipe:: mod_data
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_dav # Recipe:: mod_dav
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_dav_fs # Recipe:: mod_dav_fs
# #
# Copyright 2011-2013, Atriso # Copyright:: 2011-2013, Atriso
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_dav_lock # Recipe:: mod_dav_lock
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_dav_svn # Recipe:: mod_dav_svn
# #
# Copyright 2008-2009, Chef Software, Inc. # Copyright:: 2008-2009, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -21,7 +21,7 @@ include_recipe 'apache2::mod_dav'
package 'libapache2-svn' do package 'libapache2-svn' do
case node['platform_family'] case node['platform_family']
when 'rhel', 'fedora', 'suse' when 'rhel', 'fedora', 'suse', 'amazon'
package_name 'mod_dav_svn' package_name 'mod_dav_svn'
else else
package_name 'libapache2-svn' package_name 'libapache2-svn'
@ -29,7 +29,7 @@ package 'libapache2-svn' do
end end
case node['platform_family'] case node['platform_family']
when 'rhel', 'fedora', 'suse' when 'rhel', 'fedora', 'suse', 'amazon'
file "#{node['apache']['dir']}/conf.d/subversion.conf" do file "#{node['apache']['dir']}/conf.d/subversion.conf" do
action :delete action :delete
backup false backup false

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_dbd # Recipe:: mod_dbd
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_deflate # Recipe:: mod_deflate
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_dialup # Recipe:: mod_dialup
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_dir # Recipe:: mod_dir
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_dump_io # Recipe:: mod_dump_io
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_echo # Recipe:: mod_echo
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_env # Recipe:: mod_env
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_expires # Recipe:: mod_expires
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_ext_filter # Recipe:: mod_ext_filter
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_fastcgi # Recipe:: mod_fastcgi
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -17,37 +17,35 @@
# limitations under the License. # limitations under the License.
# #
if platform_family?('debian') if node['apache']['mod_fastcgi']['install_method'] == 'package'
if node['apache']['mod_fastcgi']['install_method'] == 'source' package node['apache']['mod_fastcgi']['package']
else
if platform_family?('debian')
package 'build-essential' package 'build-essential'
package node['apache']['devel_package'] package node['apache']['devel_package']
else elsif platform_family?('rhel', 'amazon')
package 'libapache2-mod-fastcgi' %W(gcc make libtool #{node['apache']['devel_package']} apr-devel apr).each do |package|
end package package do
elsif platform_family?('rhel') action :upgrade
%W(gcc make libtool #{node['apache']['devel_package']} apr-devel apr).each do |package| end
yum_package package do
action :upgrade
end end
end end
end
if platform_family?('rhel') || (platform_family?('debian') && node['apache']['mod_fastcgi']['install_method'] == 'source') src_filepath = "#{Chef::Config['file_cache_path']}/fastcgi.tar.gz"
src_filepath = "#{Chef::Config['file_cache_path']}/fastcgi.tar.gz"
remote_file 'download fastcgi source' do remote_file 'download fastcgi source' do
source node['apache']['mod_fastcgi']['download_url'] source node['apache']['mod_fastcgi']['download_url']
path src_filepath path src_filepath
backup false backup false
end end
if platform_family?('debian') top_dir = if platform_family?('debian')
top_dir = node['apache']['build_dir'] node['apache']['build_dir']
else else
top_dir = node['apache']['lib_dir'] node['apache']['lib_dir']
end end
include_recipe 'apache2::default' include_recipe 'apache2::default'
bash 'compile fastcgi source' do bash 'compile fastcgi source' do
notifies :run, 'execute[generate-module-list]', :immediately if platform_family?('rhel') notifies :run, 'execute[generate-module-list]', :immediately if platform_family?('rhel', 'amazon')
not_if "test -f #{node['apache']['dir']}/mods-available/fastcgi.conf" not_if "test -f #{node['apache']['dir']}/mods-available/fastcgi.conf"
cwd ::File.dirname(src_filepath) cwd ::File.dirname(src_filepath)
code <<-EOH code <<-EOH

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_fcgid # Recipe:: mod_fcgid
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -19,22 +19,34 @@
if platform_family?('debian') if platform_family?('debian')
package 'libapache2-mod-fcgid' package 'libapache2-mod-fcgid'
elsif platform_family?('rhel', 'fedora') elsif platform_family?('rhel', 'fedora', 'amazon')
package 'mod_fcgid' do package 'mod_fcgid' do
notifies :run, 'execute[generate-module-list]', :immediately notifies :run, 'execute[generate-module-list]', :immediately
end end
file "#{node['apache']['dir']}/conf.d/fcgid.conf" do file "#{node['apache']['dir']}/conf.d/fcgid.conf" do
action :delete content '# conf is under mods-available/fcgid.conf - apache2 cookbook\n'
backup false only_if { ::Dir.exist?("#{node['apache']['dir']}/conf.d") }
end end
directory '/var/run/httpd/mod_fcgid' do # CentOS 7 (and recent Fedoras) have Apache 2.4, where FCGI socket path
owner node['apache']['user'] # and shared memory path is managed adequately without further involvment
group node['apache']['group'] # neccessary (subdirectory is created under /var/run/httpd).
recursive true #
only_if { node['platform_version'].to_i >= 6 } # However, when the path is specified manually, that subdirectory is NOT
# created automatically if it doesn't already exist and Apache fails to
# start. Since in recent RHEL systems /var/run is on tmpfs, end result is
# that chef-created subdirectory disappears on shutdown, and Apache fails
# to start after server reboot. Best to leave out these two settings
# unset then.
if (node['platform_family'] == 'rhel') && (node['platform_version'].to_i == 6)
directory '/var/run/httpd/mod_fcgid' do
owner node['apache']['user']
group node['apache']['group']
recursive true
end
end end
elsif platform_family?('suse') elsif platform_family?('suse')
apache_lib_path = node['apache']['lib_dir'] apache_lib_path = node['apache']['lib_dir']

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_file_cache # Recipe:: mod_file_cache
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_filter # Recipe:: mod_filter
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_headers # Recipe:: mod_headers
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -17,4 +17,6 @@
# limitations under the License. # limitations under the License.
# #
apache_module 'headers' apache_module 'headers' do
restart true
end

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_heartbeat # Recipe:: mod_heartbeat
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_heartmonitor # Recipe:: mod_heartmonitor
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,9 +1,8 @@
# #
# Author:: Seth Chisamore (<schisamo@chef.io>) # Cookbook:: apache2
# Cookbook Name:: chef_handler # Recipe:: mod_http2
# Recipe:: json_file
# #
# Copyright 2011-2016, Chef Software, Inc. # Copyright:: 2016, Alexander van Zoest
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -18,11 +17,4 @@
# limitations under the License. # limitations under the License.
# #
# force resource actions in compile phase so exception handler apache_module 'http2'
# fires for compile phase exceptions
chef_handler 'Chef::Handler::JsonFile' do
source 'chef/handler/json_file'
arguments path: '/var/chef/reports'
action :nothing
end.run_action(:enable)

View File

@ -1,9 +1,8 @@
# #
# Author:: Seth Chisamore (<schisamo@chef.io>) # Cookbook:: apache2
# Cookbook Name:: chef_handler # Recipe:: mod_ident
# Recipe:: default
# #
# Copyright 2011-2016, Chef Software, Inc. # Copyright:: 2016, Alexander van Zoest
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -18,15 +17,4 @@
# limitations under the License. # limitations under the License.
# #
Chef::Log.info("Chef Handlers will be located at: #{node['chef_handler']['handler_path']}") apache_module 'ident'
remote_directory node['chef_handler']['handler_path'] do
source 'handlers'
unless platform?('windows')
owner 'root'
mode '0755'
recursive true
end
group node['root_group']
action :nothing
end.run_action(:create)

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_include # Recipe:: mod_include
# #
# Copyright 2012-2013, Chef Software, Inc. # Copyright:: 2012-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_info # Recipe:: mod_info
# #
# Copyright 2013, Chef Software, Inc. # Copyright:: 2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,9 +1,9 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: jk # Recipe:: jk
# #
# Copyright 2013, Mike Babineau <michael.babineau@gmail.com> # Copyright:: 2013, Mike Babineau <michael.babineau@gmail.com>
# Copyright 2013, Chef Software, Inc. # Copyright:: 2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -20,7 +20,7 @@
package 'libapache2-mod-jk' do package 'libapache2-mod-jk' do
case node['platform_family'] case node['platform_family']
when 'rhel', 'fedora', 'suse' when 'rhel', 'fedora', 'suse', 'amazon'
package_name 'mod_jk' package_name 'mod_jk'
else else
package_name 'libapache2-mod-jk' package_name 'libapache2-mod-jk'

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_lbmethod_bybusyness # Recipe:: mod_lbmethod_bybusyness
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_lbmethod_byrequests # Recipe:: mod_lbmethod_byrequests
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_lbmethod_bytraffic # Recipe:: mod_lbmethod_bytraffic
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_lbmethod_heartbeat # Recipe:: mod_lbmethod_heartbeat
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_ldap # Recipe:: mod_ldap
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -17,6 +17,10 @@
# limitations under the License. # limitations under the License.
# #
if platform_family?('rhel', 'amazon') && node['apache']['version'] == '2.4'
package 'mod_ldap'
end
apache_module 'ldap' do apache_module 'ldap' do
conf true conf true
end end

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_log_config # Recipe:: mod_log_config
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -17,7 +17,7 @@
# limitations under the License. # limitations under the License.
# #
if platform_family?('rhel', 'fedora', 'suse', 'arch', 'freebsd') if platform_family?('rhel', 'fedora', 'suse', 'arch', 'freebsd', 'amazon')
apache_module 'log_config' apache_module 'log_config'
else else
include_recipe 'apache2::default' include_recipe 'apache2::default'

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_log_debug # Recipe:: mod_log_debug
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_log_forensic # Recipe:: mod_log_forensic
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_logio # Recipe:: mod_logio
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -17,7 +17,7 @@
# limitations under the License. # limitations under the License.
# #
if platform_family?('rhel', 'fedora', 'suse', 'arch', 'freebsd') if platform_family?('rhel', 'fedora', 'suse', 'arch', 'freebsd', 'amazon')
apache_module 'logio' apache_module 'logio'
else else
include_recipe 'apache2::default' include_recipe 'apache2::default'

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_lua # Recipe:: mod_lua
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_macro # Recipe:: mod_macro
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_mime # Recipe:: mod_mime
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_mime_magic # Recipe:: mod_mime_magic
# #
# Copyright 2013, OneHealth Solutions, Inc. # Copyright:: 2013, OneHealth Solutions, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_negotiation # Recipe:: mod_negotiation
# #
# Copyright 2008-2013, Chef Software, Inc. # Copyright:: 2008-2013, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: apache2 # Cookbook:: apache2
# Recipe:: mod_pagespeed # Recipe:: mod_pagespeed
# #
# Copyright 2013, ZOZI # Copyright:: 2013, ZOZI
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

Some files were not shown because too many files have changed in this diff Show More