Module apache
In: /home/david/repos/complete/modules/apache/manifests/init.pp
/home/david/repos/complete/modules/apache/manifests/site.pp
/home/david/repos/complete/modules/apache/manifests/awstats.pp
/home/david/repos/complete/modules/apache/manifests/debian.pp

Overview

==

This module manages apache2 on Debian/etch. There are defines to handle sites and modules the Debian Way.

See also the wiki page at reductivelabs.com/trac/puppet/wiki/Recipes/DebianApache2Recipe which was originally written by Tim Stoop <tim.stoop@gmail.com>

Variables

===

The primary port (default: 80) can be configured by setting $apache2_port in the node scope.

Setting $apache2_ssl to "enabled", causes the SSL module to be installed and configured. Additionally apache2 is configured to listen on 443 or $apache2_ssl_port and use puppet‘s certificate.

Classes

=

The main class, apache2, installs apache2 with the default MPM.

The apache2::no_default_site variant additionally removes Debian‘s default site configuration.

Types

This module provides types for site and module management.

        apache2::site (
                $ensure = {*present*, absent, "filename"},
                $require_package = {*apache2*, packagename},
                $content,
                $source,
        )

This type manages the /etc/apache2/sites-available file and enables or disables the /etc/apache2/sites-enabled/$name symlink by calling a2ensite or a2dissite as neccessary.

        apache2::module (
                $ensure = {*present*, absent},
                $require = {*apache2*, packagename}
        )

This type enables or disables the /etc/apache2/mods-enabled/$name symlink by calling a2enmod or a2dismod as neccessary.

Monitoring

====

The class installs a nagios service check for the primary port. Additionally a NameVirtualHost for $hostname is configured where the server-status is available for access from $ipaddress. This is used by the munin plugins apache_accesses, apache_processes and apache_volume.

TODO

The site type should manage the sites-available file too, by providing content/source parameters.

With the recent changes to "require" stacking, the site‘s and module‘s require parameter is obsolete.

Defines

module   port   site  

Classes and Modules

Class apache::apache
Class apache::apache2
Class apache::awstats
Class apache::base
Class apache::debian

Global Variables

sites = /etc/apache2/sites
mods = /etc/apache2/mods

Defines

module( $require_package => 'apache', $ensure => 'present' )

Define an apache module. Debian packages place the module config into /etc/apache/mods-available.

You can add a custom require (string) if the module depends on packages that aren‘t part of the default apache package. Because of the package dependencies, apache will automagically be included.

port( $port )

Create a Listen directive for apache in ports.conf Use the $name to disambiguate between requests for the same port from different modules

site( $require_package => 'apache', $content => '', $ensure => 'present', $source => '' )

Define an apache site from a file.

You can add a custom require_package string if the site depends on packages that aren‘t part of the default apache package.

The parameters ensure, content and source behave like their respective counterparts on the File type.

[Validate]