apache_httpd
Version information
This version is compatible with:
- Puppet >=2.7.20 <4.1.0
- ,
Start using this module
Add this module to your Puppetfile:
mod 'thias-apache_httpd', '1.0.0'
Learn more about managing modules with a PuppetfileDocumentation
puppet apache_httpd
Overview
Install the Apache HTTP daemon and manage its main configuration as well as additional configuration snippets.
The module is very Red Hat Enterprise Linux focused, as the defaults try to change everything in ways which are typical for RHEL.
apache_httpd
: Main class for the server and its main configuration.apache_httpd::file
: Definition to manage additional configuration files.
This module disables TRACE and TRACK methods by default, which is best practice (using rewrite rules, so only when it is enabled).
Examples
Sripped down instance running as the git user for the cgit cgi :
class { 'apache_httpd':
mpm => 'worker',
modules => [ 'mime', 'setenvif', 'alias', 'proxy', 'cgi' ],
keepalive => 'On',
user => 'git',
group => 'git',
}
Complete instance with https, a typical module list ready for php and the original Red Hat welcome page disabled :
apache_httpd { 'prefork':
ssl => true,
modules => [
'auth_basic',
'authn_file',
'authz_host',
'authz_user',
'mime',
'negotiation',
'dir',
'alias',
'rewrite',
'proxy',
],
welcome => false,
}
Example entry for hiera to change some of the defaults globally :
---
apache_httpd::extendedstatus: 'On'
apache_httpd::serveradmin: 'root@example.com'
apache_httpd::serversignature: 'Off'
Configuration snippets can be added from anywhere in your manifest, based on files or templates, and will automatically reload httpd when changed :
apache_httpd::file { 'www.example.com.conf':
source => 'puppet:///modules/mymodule/httpd.d/www.example.com.conf',
}
apache_httpd::file { 'global-alias.conf':
content => 'Alias /whatever /var/www/whatever',
}
apache_httpd::file { 'myvhosts.conf':
content => template('mymodule/httpd.d/myvhosts.conf.erb'),
}
Note that when adding or removing modules, a reload might not be sufficient, in which case you will have to perform a full restart by other means.
Updating
Before version 0.5 of the module, apache_httpd
was a definition for
historical reasons : It wasn't possible to pass parameters to classes when
the module was initially written. Starting with 0.5.0, apache_httpd
is now
a class, making the module more flexible with Hiera or an ENC.
Migrating to using the class is trivial :
apache_httpd { 'prefork':
# Parameters here...
}
Becomes (since 'prefork'
was the default) :
class { '::apache_httpd':
# Same parameters here...
}
And the 'worker'
title becomes the mpm => 'worker'
parameter.
2015-04-28 - 1.0.0
- Fix OS version check for Puppet 4.
- Replace Modulefile with metadata.json.
2014-11-11 - 0.5.0
- Change apache_httpd from a definition to a class, it was about time.
- Create params class for setting defaults, overridable with hiera.
- Make the service_restart command configurable (reload by default).
- Simplify the service by merging back the classes into the main class.
- Fix OS version comparison for CentOS 7.
2013-10-01 - 0.4.2
- Add global servername parameter.
2013-04-19 - 0.4.1
- Use @varname syntax in templates to silence puppet 3.2 warnings.
2013-03-08 - 0.4.0
- Split module out to its own repo.
- Update README and switch to markdown.
- Cosmetic cleanups.
2012-04-26 - 0.3.2
- Fix logrotate file, the PID path was wrong for most systems (thomasvs).
- Make sure the default logrotate file is identical to the original RHEL6 one.
2012-04-20 - 0.3.1
- Support multiple listens and setting namevirtualhosts (Jared Curtis).
2012-03-07 - 0.3.0
- Rename from apache-httpd to apache_httpd to conform with puppetlabs docs.
- Update tests to cover more cases.
- Include LICENSE since the module will be distributed individually.
- Update included documentation details.
Copyright (C) 2011-2015 Matthias Saou 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.