{ "uri": "/v3/modules/puppetlabs-apache", "name": "apache", "downloads": 81387, "created_at": "2010-05-20 22:43:19 -0700", "updated_at": "2014-01-06 14:42:07 -0800", "owner": { "uri": "/v3/users/puppetlabs", "username": "puppetlabs", "gravatar_id": "fdd009b7c1ec96e088b389f773e87aec" }, "current_release": { "uri": "/v3/releases/puppetlabs-apache-0.10.0", "module": { "uri": "/v3/modules/puppetlabs-apache", "name": "apache", "owner": { "uri": "/v3/users/puppetlabs", "username": "puppetlabs", "gravatar_id": "fdd009b7c1ec96e088b389f773e87aec" } }, "version": "0.10.0", "metadata": { "name": "puppetlabs-apache", "version": "0.10.0", "source": "git://github.com/puppetlabs/puppetlabs-apache.git", "author": "puppetlabs", "license": "Apache 2.0", "summary": "Puppet module for Apache", "description": "Module for Apache configuration", "project_page": "https://github.com/puppetlabs/puppetlabs-apache", "dependencies": [ { "name": "puppetlabs/stdlib", "version_requirement": ">= 2.4.0" }, { "name": "puppetlabs/concat", "version_requirement": ">= 1.0.0" } ], "types": [ { "name": "a2mod", "doc": "Manage Apache 2 modules", "properties": [ { "name": "ensure", "doc": "The basic property that the resource should be in. Valid values are `present`, `absent`." } ], "parameters": [ { "name": "name", "doc": "The name of the module to be managed" }, { "name": "lib", "doc": "The name of the .so library to be loaded" }, { "name": "identifier", "doc": "Module identifier string used by LoadModule. Default: module-name_module" } ], "providers": [ { "name": "a2mod", "doc": "Manage Apache 2 modules on Debian and Ubuntu\n\nRequired binaries: `a2enmod`, `a2dismod`, `apache2ctl`. Default for `operatingsystem` == `debian, ubuntu`." }, { "name": "gentoo", "doc": "Manage Apache 2 modules on Gentoo\n\nDefault for `operatingsystem` == `gentoo`." }, { "name": "modfix", "doc": "Dummy provider for A2mod.\n\n Fake nil resources when there is no crontab binary available. Allows\n puppetd to run on a bootstrapped machine before a Cron package has been\n installed. Workaround for: http://projects.puppetlabs.com/issues/2384\n " }, { "name": "redhat", "doc": "Manage Apache 2 modules on RedHat family OSs\n\nRequired binaries: `apachectl`. Default for `osfamily` == `redhat`." } ] } ], "checksums": { "CHANGELOG.md": "2ed7b976e9c4542fd1626006cb44783b", "CONTRIBUTING.md": "5520c75162725951733fa7d88e57f31f", "Gemfile": "c1cd7b0477f1a99e0156a471aac6cd58", "Gemfile.lock": "13733647826ec5cff955b593fd9a9c5c", "LICENSE": "b3f8a01d8699078d82e8c3c992307517", "Modulefile": "560b5e9d2b04ddbc23f3803645bfbda5", "README.md": "c937c2d34a76185fe8cfc61d671c47ec", "README.passenger.md": "0316c4a152fd51867ece8ea403250fcb", "Rakefile": "0428ea3759a4692c91604396c406a9c1", "files/httpd": "295f5e924afe6f752d29327e73fe6d0a", "lib/puppet/provider/a2mod/a2mod.rb": "d986d8e8373f3f31c97359381c180628", "lib/puppet/provider/a2mod/gentoo.rb": "2492d446adbb68f678e86a75eb7ff3bd", "lib/puppet/provider/a2mod/modfix.rb": "b689a1c83c9ccd8590399c67f3e588e5", "lib/puppet/provider/a2mod/redhat.rb": "c39b80e75e7d0666def31c2a6cdedb0b", "lib/puppet/provider/a2mod.rb": "03ed73d680787dd126ea37a03be0b236", "lib/puppet/type/a2mod.rb": "9042ccc045bfeecca28bebb834114f05", "manifests/balancer.pp": "c635b2d2dec8b5972509960152e169a3", "manifests/balancermember.pp": "8afe51921a42545402fa457820162ae2", "manifests/confd/no_accf.pp": "c44b75749a3a56c0306433868d6b762c", "manifests/default_confd_files.pp": "7cbc2f15bfd34eb2f5160c671775c0f6", "manifests/default_mods/load.pp": "b3f21b3186216795dd18ee051f01e3c2", "manifests/default_mods.pp": "ea267ac599fc3d76db6298c3710cee60", "manifests/dev.pp": "639ba24711be5d7cea0c792e05008c86", "manifests/init.pp": "ffc69874d88f7ac581138fbf47d04d04", "manifests/listen.pp": "5efc62bd75a0a9a9565b12bd8cb2a9e4", "manifests/mod/alias.pp": "3c144a2aa8231de61e68eced58dc9287", "manifests/mod/auth_basic.pp": "47ff846317d52d2161c6d09cac05f7f8", "manifests/mod/auth_kerb.pp": "7876ffdca25396285a26afae8dd030eb", "manifests/mod/authnz_ldap.pp": "10c795251b2327614ef0b433591ed128", "manifests/mod/autoindex.pp": "1b07e7737b4b27f977f80c289172a55b", "manifests/mod/cache.pp": "51b4826a72090da8e463bc007695f05b", "manifests/mod/cgi.pp": "8c9265733584e188196fe69fd3b9fdd7", "manifests/mod/cgid.pp": "d218c11d4798453d6075f8f1553c94de", "manifests/mod/dav.pp": "f0228b06b7101864f7c943b541e570d2", "manifests/mod/dav_fs.pp": "a166fc9b780abea2eec1ab723ce3a773", "manifests/mod/dav_svn.pp": "641911969d921123865e6566954c0edb", "manifests/mod/deflate.pp": "f317ddf1cbfee52945d0433a3b25c728", "manifests/mod/dev.pp": "d6a001af402d8e82e952c8243c5e5321", "manifests/mod/dir.pp": "f3c3e6a21653ebda12f35b4b140e68d5", "manifests/mod/disk_cache.pp": "f19193d4f119224e19713e0c96a0de6d", "manifests/mod/event.pp": "e48aefd215dd61980f0b9c4d16ef094a", "manifests/mod/expires.pp": "a9b7537846258af84f12b8ce3510dfa8", "manifests/mod/fastcgi.pp": "fec8afea5424f25109a0b7ca912b16b1", "manifests/mod/fcgid.pp": "d03eb1add8f2cef603331dde96f1f7fd", "manifests/mod/headers.pp": "224438518465d09c951eb00dbaf8123c", "manifests/mod/info.pp": "9a45dd07a2681dc1fef9204de3f42bd9", "manifests/mod/itk.pp": "7c32234950dc74354b06a2da15197179", "manifests/mod/ldap.pp": "f5033ee5197938d402854d8ffa9fb1d3", "manifests/mod/mime.pp": "0fa7835f270e511616927afe01a0526c", "manifests/mod/mime_magic.pp": "fe249dd7e1faa5ec5dd936877c64e856", "manifests/mod/negotiation.pp": "9f5d70e4c961175a78a049fedaac85c9", "manifests/mod/nss.pp": "f7a7efaac854599aa7b872665eb5d93c", "manifests/mod/passenger.pp": "e6c48c22a69933b0975609f2bacf2b5d", "manifests/mod/perl.pp": "72195ad624f68e2c0009074d118bf8e4", "manifests/mod/peruser.pp": "3a2eaab65d7be2373740302eac33e5b1", "manifests/mod/php.pp": "a3725f487f58eb354c84a4fee704daa9", "manifests/mod/prefork.pp": "84b64cb7b46ab0c544dfecb476d65e3d", "manifests/mod/proxy.pp": "eb1e8895edee5e97edc789923fc128c8", "manifests/mod/proxy_ajp.pp": "f9b72f1339cc03f068fa684f38793120", "manifests/mod/proxy_balancer.pp": "5ab6987614f8a1afde3a8b701fbbe22a", "manifests/mod/proxy_html.pp": "1a96fd029a305eb88639bf5baf06abdd", "manifests/mod/proxy_http.pp": "773d0fbb934440a24b3bc87517faa4d4", "manifests/mod/python.pp": "0b22df3d0e9a39ce948212e18329155f", "manifests/mod/reqtimeout.pp": "2ff860e05de7352d4a1bcd57c0ee08f0", "manifests/mod/rewrite.pp": "165fdccc8acc61e5fb088d9917861a3c", "manifests/mod/rpaf.pp": "1125f0c5296ca584fa71de474c95475f", "manifests/mod/setenvif.pp": "32098aaab01723cae4c44d2fff8114ea", "manifests/mod/ssl.pp": "c8ab5728fda7814dace9a8eebf13476c", "manifests/mod/status.pp": "d7366470082970ac62984581a0ea3fd7", "manifests/mod/suphp.pp": "c42d20b057007eff1a75595fc3fe7adf", "manifests/mod/userdir.pp": "7166fee20a3e5b97d61dfae18fb745c9", "manifests/mod/vhost_alias.pp": "ea2d06875ed4f47ba65da0f7169e529e", "manifests/mod/worker.pp": "b1809ac41b322b090be410d41e57157e", "manifests/mod/wsgi.pp": "a0073502c2267d7e72caaf9f4942ab7c", "manifests/mod/xsendfile.pp": "ebe6241729f1b0d8125043a1f34caa54", "manifests/mod.pp": "2d4ab8907db92e50c5ed6e1357fed9fb", "manifests/namevirtualhost.pp": "27bb9faa95147fcd15ec2aa0a95bc3af", "manifests/package.pp": "c32ba42fe3ab4acc49d2e28258108ba1", "manifests/params.pp": "221fa0dcbdd00066e074bc443c0d8fdb", "manifests/peruser/multiplexer.pp": "712017c1d1cee710cd7392a4c4821044", "manifests/peruser/processor.pp": "293fcb9d2e7ae98b36f544953e33074e", "manifests/php.pp": "a4478838b4cf9b0525b04db150cf55b8", "manifests/proxy.pp": "54e7657920b580546f3bef3980f2fd03", "manifests/python.pp": "2edb06e8119b67a5a62fb24fb280d3e5", "manifests/service.pp": "56e90e48165989a7df3360dc55b01360", "manifests/ssl.pp": "7f944d1c103a59ebd04d02e68af69f7a", "manifests/vhost/custom.pp": "58bd40d3d12d01549545b85667855d38", "manifests/vhost.pp": "41c68c9ef48c3ef9d1c4feb167d71dd2", "spec/classes/apache_spec.rb": "70ebba6cbb794fe0239b0e353796bae9", "spec/classes/dev_spec.rb": "051fcee20c1b04a7d52481c4a23682b3", "spec/classes/mod/auth_kerb_spec.rb": "229c730ac88b05c4ea4e64d395f26f27", "spec/classes/mod/authnz_ldap_spec.rb": "19cef4733927bc3548af8c75a66a8b11", "spec/classes/mod/dav_svn_spec.rb": "b41e721c0b5c7bac1295187f89d27ab7", "spec/classes/mod/dev_spec.rb": "81d37ad0a51e6cae22e79009e719d648", "spec/classes/mod/dir_spec.rb": "a8d473ce36e0aaec0f9f3463cd4bb549", "spec/classes/mod/event_spec.rb": "cce445ab0a7140bdb50897c6f692ec17", "spec/classes/mod/fastcgi_spec.rb": "ff35691208f95aee61150682728c2891", "spec/classes/mod/fcgid_spec.rb": "ca3ee773bdf9ac82e63edee4411d0281", "spec/classes/mod/info_spec.rb": "90f35932812cc86058b6ccfd48eba6e8", "spec/classes/mod/itk_spec.rb": "261aa7759e232f07d70b102f0e8ab828", "spec/classes/mod/mime_magic_spec.rb": "a3748b9bd66514b56aa29a377a233606", "spec/classes/mod/passenger_spec.rb": "ece983e4b228f99f670a5f98878f964b", "spec/classes/mod/perl_spec.rb": "123e73d8de752e83336bed265a354c08", "spec/classes/mod/peruser_spec.rb": "72d00a427208a3bc0dda5578d36e7b0e", "spec/classes/mod/php_spec.rb": "3907e0075049b0d3cdadb17445acae2d", "spec/classes/mod/prefork_spec.rb": "537882d6f314a17c3ead6f51a67b20b8", "spec/classes/mod/proxy_html_spec.rb": "3587873d56172c431f93a78845b7d24e", "spec/classes/mod/python_spec.rb": "9011cd2ac1d452daec091e5cf337dbe7", "spec/classes/mod/rpaf_spec.rb": "b419712d8e6acbe00f5c4034161e40af", "spec/classes/mod/ssl_spec.rb": "969111556de99092152735764194d267", "spec/classes/mod/status_spec.rb": "a1f70673810840e591ac25a1803c39d7", "spec/classes/mod/suphp_spec.rb": "1da3f6561f19d8c7f2a71655fa7772ea", "spec/classes/mod/worker_spec.rb": "cf005d3606362360f7fcccce04e53be6", "spec/classes/mod/wsgi_spec.rb": "37ad1d623b1455e237a75405776d58d9", "spec/classes/params_spec.rb": "9b1984a3e8a485ff128512833400dfbd", "spec/classes/service_spec.rb": "d522ae1652cc87a4b9c6e33034ee5774", "spec/defines/mod_spec.rb": "80d167b475191b63713087462e960a44", "spec/defines/vhost_spec.rb": "89905755a72b938e99f4a01ef64203e9", "spec/fixtures/modules/site_apache/templates/fake.conf.erb": "6b0431dd0b9a0bf803eb0684300c2cff", "spec/spec.opts": "c407193b3d9028941ef59edd114f5968", "spec/spec_helper.rb": "0db89c9a486df193c0e40095422e19dc", "spec/spec_helper_system.rb": "c54584d03120766bac28221597920d3d", "spec/system/basic_spec.rb": "73bab7cf3eb0554b7d7801613c4b483e", "spec/system/class_spec.rb": "6f29d603a809ae6208243911c0b250e4", "spec/system/default_mods_spec.rb": "fff758602ee95ee67cad2abc71bc54fb", "spec/system/itk_spec.rb": "c645ac3b306da4d3733c33f662959e36", "spec/system/mod_php_spec.rb": "b823cdcfe4288359a3d2dfd70868691d", "spec/system/mod_suphp_spec.rb": "9d38045b3dcb052153e7c08164301c13", "spec/system/prefork_worker_spec.rb": "a6f1b3fb3024a0dce75e45a7c2d6cfd0", "spec/system/service_spec.rb": "3cd71e4e40790e1624487fd233f18a07", "spec/system/vhost_spec.rb": "86e147833f1acebf2b08451f02919581", "spec/unit/provider/a2mod/gentoo_spec.rb": "24ad9db4f6ba0b4fc7ed77b509b4244c", "templates/confd/no-accf.conf.erb": "a614f28c4b54370e4fa88403dfe93eb0", "templates/httpd.conf.erb": "6e768a748deb4737a8faf82ea80196c1", "templates/listen.erb": "6286aa08f9e28caee54b1e1ee031b9d6", "templates/mod/alias.conf.erb": "e65c27aafd88c825ab35b34dd04221ea", "templates/mod/authnz_ldap.conf.erb": "12c9a1482694ddad3143e5eef03fb531", "templates/mod/autoindex.conf.erb": "2421a3c6df32c7e38c2a7a22afdf5728", "templates/mod/cgid.conf.erb": "3d4e24001b50eb16561e45f5a8237b32", "templates/mod/dav_fs.conf.erb": "fdf1f8cff4708a282ef491d60868d1d7", "templates/mod/deflate.conf.erb": "44d54f557a5612be8da04c49dd6da862", "templates/mod/dir.conf.erb": "2485da78a2506c14bf51dde38dd03360", "templates/mod/disk_cache.conf.erb": "7d3e7a5ee3bd7b6a839924b06a60667f", "templates/mod/event.conf.erb": "dc4223dfb2729e54d4a33cdec03bd518", "templates/mod/fastcgi.conf.erb": "8692d14c4462335c845eede011f6db2f", "templates/mod/info.conf.erb": "bb48951beaeaf582d1a1023cb661ac32", "templates/mod/itk.conf.erb": "eff84b78e4f2f8c5c3a2e9fc4b8aad16", "templates/mod/ldap.conf.erb": "a8a33f645497e0dbcec363c98be43795", "templates/mod/mime.conf.erb": "8f953519790a5900369fb656054cae35", "templates/mod/mime_magic.conf.erb": "f910e66299cba6ead5f0444e522a0c76", "templates/mod/mpm_event.conf.erb": "80097a19d063a4f973465d9ef5c0c0bf", "templates/mod/negotiation.conf.erb": "47284b5580b986a6ba32580b6ffb9fd7", "templates/mod/nss.conf.erb": "9a9667d308f0783448ca2689b9fc2b93", "templates/mod/passenger.conf.erb": "68a350cf4cf037c2ae64f015cc7a61a3", "templates/mod/peruser.conf.erb": "ac1c2bf2a771ed366f688ec337d6da02", "templates/mod/php5.conf.erb": "49e2d214790835c141fcaf6d74b5a96d", "templates/mod/prefork.conf.erb": "f9ec5a7eaea78a19b04fa69f8acd8a84", "templates/mod/proxy.conf.erb": "38668e1cb5a19d7708e9d26f99e21264", "templates/mod/proxy_html.conf.erb": "67546d56f2d6bb1860338257e3ac9d29", "templates/mod/reqtimeout.conf.erb": "81c51851ab7ee7942bef389dc7c0e985", "templates/mod/rpaf.conf.erb": "5447539c083ae54f3a9e93c1ac8c988b", "templates/mod/setenvif.conf.erb": "c7ede4173da1915b7ec088201f030c28", "templates/mod/ssl.conf.erb": "907dc25931c6bdb7ce4b61a81be788f8", "templates/mod/status.conf.erb": "afb05015a8337b232127199aa085a023", "templates/mod/suphp.conf.erb": "05bb7b3ea23976b032ce405bfd4edd18", "templates/mod/userdir.conf.erb": "e5a7a7229dbf0de07bc034dd3d108ea2", "templates/mod/worker.conf.erb": "9661e7a59eaefb9f17d4c2680c0d243d", "templates/mod/wsgi.conf.erb": "125949c9120aee15303ad755e105d852", "templates/namevirtualhost.erb": "fbfca19a639e18e6c477e191344ac8ae", "templates/ports_header.erb": "afe35cb5747574b700ebaa0f0b3a626e", "templates/vhost/_aliases.erb": "e5e3ba8a9ce994334644bd19ad342d8b", "templates/vhost/_block.erb": "7cb56db9254729b54e8d30686c4f3b1a", "templates/vhost/_custom_fragment.erb": "67a4475275ec9208e6421b047b9ed7f4", "templates/vhost/_directories.erb": "eca2a0abc3a23d1e08b1132baeade372", "templates/vhost/_error_document.erb": "81d3007c1301a5c5f244c082cfee9de2", "templates/vhost/_fastcgi.erb": "e0a1702445e9be189dabe04b829acd7f", "templates/vhost/_itk.erb": "db5b12d7236dbc19b62ce13625d9d60e", "templates/vhost/_proxy.erb": "1f9cc42aaafb80a658294fc39cf61395", "templates/vhost/_rack.erb": "ebe187c1bdc81eec9c8e0d9026120b18", "templates/vhost/_redirect.erb": "0e2eed04e30240fbbd6c4ef7db6b7058", "templates/vhost/_requestheader.erb": "db1b0cdda069ae809b5b83b0871ef991", "templates/vhost/_rewrite.erb": "dcf423c014bdb222bcf15314a2f3a41f", "templates/vhost/_scriptalias.erb": "9c714277eaad73d05d073c1b6c62106a", "templates/vhost/_serveralias.erb": "2ef30c2152b9284463588f408f7f371f", "templates/vhost/_setenv.erb": "da6778b324857234c8441ef346d08969", "templates/vhost/_ssl.erb": "e9fca0c12325af10797b80d827dfddee", "templates/vhost/_suphp.erb": "6ea2553a4c4284d41b435fa2f4f4edc7", "templates/vhost/_wsgi.erb": "3bbab1e5757dfb584504f05354275f81", "templates/vhost.conf.erb": "5dc0337da18ff36184df07343982dc93", "tests/apache.pp": "819cf9116ffd349e6757e1926d11ca2f", "tests/dev.pp": "4cf15c1fecea3ca86009f182b402c7ab", "tests/init.pp": "4eac4a7ef68499854c54a78879e25535", "tests/mod_load_params.pp": "5981af4d625a906fce1cedeb3f70cb90", "tests/mods.pp": "0085911ba562b7e56ad8d793099c9240", "tests/mods_custom.pp": "9afd068edce0538b5c55a3bc19f9c24a", "tests/php.pp": "60e7939034d531dd6b95af35338bcbe7", "tests/vhost.pp": "164bec943d7d5eee1ad6d6c41fe7c28e", "tests/vhost_directories.pp": "b79a3bcf72474ce4e3b75f6a70cbf272", "tests/vhost_ip_based.pp": "7d9f7b6976de7488ab6ff0a6e647fc73", "tests/vhost_ssl.pp": "9f3716bc15a9a6760f1d6cc3bf8ce8ac", "tests/vhosts_without_listen.pp": "a6692104056a56517b4365bcc816e7f4" } }, "tags": [ "apache", "web", "virtualhost", "httpd", "centos", "rhel", "debian", "ubuntu", "apache2", "ssl", "passenger", "wsgi", "proxy", "virtual_host" ], "file_uri": "/v3/files/puppetlabs-apache-0.10.0.tar.gz", "file_size": 85004, "file_md5": "4036f35903264c9b6e3289455cfee225", "downloads": 6389, "readme": "

apache

\n\n

\"Build

\n\n

Table of Contents

\n\n
    \n
  1. Overview - What is the Apache module?
  2. \n
  3. Module Description - What does the module do?
  4. \n
  5. Setup - The basics of getting started with Apache\n\n
  6. \n
  7. Usage - The classes, defined types, and their parameters available for configuration\n\n
  8. \n
  9. Implementation - An under-the-hood peek at what the module is doing\n\n
  10. \n
  11. Limitations - OS compatibility, etc.
  12. \n
  13. Development - Guide for contributing to the module
  14. \n
  15. Release Notes - Notes on the most recent updates to the module
  16. \n
\n\n

Overview

\n\n

The Apache module allows you to set up virtual hosts and manage web services with minimal effort.

\n\n

Module Description

\n\n

Apache is a widely-used web server, and this module provides a simplified way of creating configurations to manage your infrastructure. This includes the ability to configure and manage a range of different virtual host setups, as well as a streamlined way to install and configure Apache modules.

\n\n

Setup

\n\n

What Apache affects:

\n\n\n\n

Beginning with Apache

\n\n

To install Apache with the default parameters

\n\n
    class { 'apache':  }\n
\n\n

The defaults are determined by your operating system (e.g. Debian systems have one set of defaults, RedHat systems have another). These defaults will work well in a testing environment, but are not suggested for production. To establish customized parameters

\n\n
    class { 'apache':\n      default_mods        => false,\n      default_confd_files => false,\n    }\n
\n\n

Configure a virtual host

\n\n

Declaring the apache class will create a default virtual host by setting up a vhost on port 80, listening on all interfaces and serving $apache::docroot.

\n\n
    class { 'apache': }\n
\n\n

To configure a very basic, name-based virtual host

\n\n
    apache::vhost { 'first.example.com':\n      port    => '80',\n      docroot => '/var/www/first',\n    }\n
\n\n

Note: The default priority is 15. If nothing matches this priority, the alphabetically first name-based vhost will be used. This is also true if you pass a higher priority and no names match anything else.

\n\n

A slightly more complicated example, which moves the docroot owner/group

\n\n
    apache::vhost { 'second.example.com':\n      port          => '80',\n      docroot       => '/var/www/second',\n      docroot_owner => 'third',\n      docroot_group => 'third',\n    }\n
\n\n

To set up a virtual host with SSL and default SSL certificates

\n\n
    apache::vhost { 'ssl.example.com':\n      port    => '443',\n      docroot => '/var/www/ssl',\n      ssl     => true,\n    }\n
\n\n

To set up a virtual host with SSL and specific SSL certificates

\n\n
    apache::vhost { 'fourth.example.com':\n      port     => '443',\n      docroot  => '/var/www/fourth',\n      ssl      => true,\n      ssl_cert => '/etc/ssl/fourth.example.com.cert',\n      ssl_key  => '/etc/ssl/fourth.example.com.key',\n    }\n
\n\n

To set up a virtual host with IP address different than '*'

\n\n
    apache::vhost { 'subdomain.example.com':\n      ip      => '127.0.0.1',\n      port    => '80',\n      docrout => '/var/www/subdomain',\n    }\n
\n\n

To set up a virtual host with wildcard alias for subdomain mapped to same named directory\nhttp://examle.com.loc => /var/www/example.com

\n\n
    apache::vhost { 'subdomain.loc':\n      vhost_name => '*',\n      port       => '80',\n      virtual_docroot' => '/var/www/%-2+',\n      docroot          => '/var/www',\n      serveraliases    => ['*.loc',],\n    }\n
\n\n

To set up a virtual host with suPHP

\n\n
    apache::vhost { 'suphp.example.com':\n      port                => '80',\n      docroot             => '/home/appuser/myphpapp',\n      suphp_addhandler    => 'x-httpd-php',\n      suphp_engine        => 'on',\n      suphp_configpath    => '/etc/php5/apache2',\n      directories         => { path => '/home/appuser/myphpapp',\n        'suphp'           => { user => 'myappuser', group => 'myappgroup' },\n      }\n    }\n
\n\n

To set up a virtual host with WSGI

\n\n
    apache::vhost { 'wsgi.example.com':\n      port                        => '80',\n      docroot                     => '/var/www/pythonapp',\n      wsgi_daemon_process         => 'wsgi',\n      wsgi_daemon_process_options =>\n        { processes => '2', threads => '15', display-name => '%{GROUP}' },\n      wsgi_process_group          => 'wsgi',\n      wsgi_script_aliases         => { '/' => '/var/www/demo.wsgi' },\n    }\n
\n\n

Starting 2.2.16, httpd supports FallbackResource which is a simple replace for common RewriteRules:

\n\n
    apache::vhost { 'wordpress.example.com':\n      port                => '80',\n      docroot             => '/var/www/wordpress',\n      fallbackresource    => '/index.php',\n    }\n
\n\n

Please note that the disabled argument to FallbackResource is only supported since 2.2.24.

\n\n

To see a list of all virtual host parameters, please go here. To see an extensive list of virtual host examples please look here.

\n\n

Usage

\n\n

Classes and Defined Types

\n\n

This module modifies Apache configuration files and directories and will purge any configuration not managed by Puppet. Configuration of Apache should be managed by Puppet, as non-puppet configuration files can cause unexpected failures.

\n\n

It is possible to temporarily disable full Puppet management by setting the purge_configs parameter within the base apache class to 'false'. This option should only be used as a temporary means of saving and relocating customized configurations.

\n\n

Class: apache

\n\n

The Apache module's primary class, apache, guides the basic setup of Apache on your system.

\n\n

You may establish a default vhost in this class, the vhost class, or both. You may add additional vhost configurations for specific virtual hosts using a declaration of the vhost type.

\n\n

Parameters within apache:

\n\n
default_mods
\n\n

Sets up Apache with default settings based on your OS. Defaults to 'true', set to 'false' for customized configuration.

\n\n
default_vhost
\n\n

Sets up a default virtual host. Defaults to 'true', set to 'false' to set up customized virtual hosts.

\n\n
default_confd_files
\n\n

Generates default set of include-able apache configuration files under ${apache::confd_dir} directory. These configuration files correspond to what is usually installed with apache package on given platform.

\n\n
default_ssl_vhost
\n\n

Sets up a default SSL virtual host. Defaults to 'false'.

\n\n
    apache::vhost { 'default-ssl':\n      port            => 443,\n      ssl             => true,\n      docroot         => $docroot,\n      scriptalias     => $scriptalias,\n      serveradmin     => $serveradmin,\n      access_log_file => "ssl_${access_log_file}",\n      }\n
\n\n

SSL vhosts only respond to HTTPS queries.

\n\n
default_ssl_cert
\n\n

The default SSL certification, which is automatically set based on your operating system (/etc/pki/tls/certs/localhost.crt for RedHat, /etc/ssl/certs/ssl-cert-snakeoil.pem for Debian, /usr/local/etc/apache22/server.crt for FreeBSD). This default will work out of the box but must be updated with your specific certificate information before being used in production.

\n\n
default_ssl_key
\n\n

The default SSL key, which is automatically set based on your operating system (/etc/pki/tls/private/localhost.key for RedHat, /etc/ssl/private/ssl-cert-snakeoil.key for Debian, /usr/local/etc/apache22/server.key for FreeBSD). This default will work out of the box but must be updated with your specific certificate information before being used in production.

\n\n
default_ssl_chain
\n\n

The default SSL chain, which is automatically set to 'undef'. This default will work out of the box but must be updated with your specific certificate information before being used in production.

\n\n
default_ssl_ca
\n\n

The default certificate authority, which is automatically set to 'undef'. This default will work out of the box but must be updated with your specific certificate information before being used in production.

\n\n
default_ssl_crl_path
\n\n

The default certificate revocation list path, which is automatically set to 'undef'. This default will work out of the box but must be updated with your specific certificate information before being used in production.

\n\n
default_ssl_crl
\n\n

The default certificate revocation list to use, which is automatically set to 'undef'. This default will work out of the box but must be updated with your specific certificate information before being used in production.

\n\n
service_name
\n\n

Name of apache service to run. Defaults to: 'httpd' on RedHat, 'apache2' on Debian, and 'apache22' on FreeBSD.

\n\n
service_enable
\n\n

Determines whether the 'httpd' service is enabled when the machine is booted. Defaults to 'true'.

\n\n
service_ensure
\n\n

Determines whether the service should be running. Can be set to 'undef' which is useful when you want to let the service be managed by some other application like pacemaker. Defaults to 'running'.

\n\n
purge_configs
\n\n

Removes all other apache configs and vhosts, which is automatically set to true. Setting this to false is a stopgap measure to allow the apache module to coexist with existing or otherwise managed configuration. It is recommended that you move your configuration entirely to resources within this module.

\n\n
serveradmin
\n\n

Sets the server administrator. Defaults to 'root@localhost'.

\n\n
servername
\n\n

Sets the servername. Defaults to fqdn provided by facter.

\n\n
server_root
\n\n

A value to be set as ServerRoot in main configuration file (httpd.conf). Defaults to /etc/httpd on RedHat, /etc/apache2 on Debian and /usr/local on FreeBSD.

\n\n
sendfile
\n\n

Makes Apache use the Linux kernel 'sendfile' to serve static files. Defaults to 'On'.

\n\n
server_root
\n\n

A value to be set as ServerRoot in main configuration file (httpd.conf). Defaults to /etc/httpd on RedHat and /etc/apache2 on Debian.

\n\n
error_documents
\n\n

Enables custom error documents. Defaults to 'false'.

\n\n
httpd_dir
\n\n

Changes the base location of the configuration directories used for the service. This is useful for specially repackaged HTTPD builds but may have unintended consequences when used in combination with the default distribution packages. Default is based on your OS.

\n\n
confd_dir
\n\n

Changes the location of the configuration directory your custom configuration files are placed in. Default is based on your OS.

\n\n
vhost_dir
\n\n

Changes the location of the configuration directory your virtual host configuration files are placed in. Default is based on your OS.

\n\n
mod_dir
\n\n

Changes the location of the configuration directory your Apache modules configuration files are placed in. Default is based on your OS.

\n\n
mpm_module
\n\n

Configures which mpm module is loaded and configured for the httpd process by the apache::mod::event, apache::mod::itk, apache::mod::peruser, apache::mod::prefork and apache::mod::worker classes. Must be set to false to explicitly declare apache::mod::event, apache::mod::itk, apache::mod::peruser, apache::mod::prefork or apache::mod::worker classes with parameters. All possible values are event, itk, peruser, prefork, worker (valid values depend on agent's OS), or the boolean false. Defaults to prefork on RedHat and FreeBSD and worker on Debian. Note: on FreeBSD switching between different mpm modules is quite difficult (but possible). Before changing $mpm_module one has to deinstall all packages that depend on currently installed apache.

\n\n
conf_template
\n\n

Setting this allows you to override the template used for the main apache configuration file. This is a potentially risky thing to do as this module has been built around the concept of a minimal configuration file with most of the configuration coming in the form of conf.d/ entries. Defaults to 'apache/httpd.conf.erb'.

\n\n
keepalive
\n\n

Setting this allows you to enable persistent connections.

\n\n
keepalive_timeout
\n\n

Amount of time the server will wait for subsequent requests on a persistent connection. Defaults to '15'.

\n\n
logroot
\n\n

Changes the location of the directory Apache log files are placed in. Defaut is based on your OS.

\n\n
log_level
\n\n

Changes the verbosity level of the error log. Defaults to 'warn'. Valid values are emerg, alert, crit, error, warn, notice, info or debug.

\n\n
ports_file
\n\n

Changes the name of the file containing Apache ports configuration. Default is ${conf_dir}/ports.conf.

\n\n
server_tokens
\n\n

Controls how much information Apache sends to the browser about itself and the operating system. See Apache documentation for 'ServerTokens'. Defaults to 'OS'.

\n\n
server_signature
\n\n

Allows the configuration of a trailing footer line under server-generated documents. See Apache documentation for 'ServerSignature'. Defaults to 'On'.

\n\n
trace_enable
\n\n

Controls, how TRACE requests per RFC 2616 are handled. See Apache documentation for 'TraceEnable'. Defaults to 'On'.

\n\n
manage_user
\n\n

Setting this to false will avoid the user resource to be created by this module. This is useful when you already have a user created in another puppet module and that you want to used it to run apache. Without this, it would result in a duplicate resource error.

\n\n
manage_group
\n\n

Setting this to false will avoid the group resource to be created by this module. This is useful when you already have a group created in another puppet module and that you want to used it for apache. Without this, it would result in a duplicate resource error.

\n\n
package_ensure
\n\n

Allow control over the package ensure statement. This is useful if you want to make sure apache is always at the latest version or whether it is only installed.

\n\n

Class: apache::default_mods

\n\n

Installs default Apache modules based on what OS you are running

\n\n
    class { 'apache::default_mods': }\n
\n\n

Defined Type: apache::mod

\n\n

Used to enable arbitrary Apache httpd modules for which there is no specific apache::mod::[name] class. The apache::mod defined type will also install the required packages to enable the module, if any.

\n\n
    apache::mod { 'rewrite': }\n    apache::mod { 'ldap': }\n
\n\n

Classes: apache::mod::[name]

\n\n

There are many apache::mod::[name] classes within this module that can be declared using include:

\n\n\n\n

Modules noted with a * indicate that the module has settings and, thus, a template that includes parameters. These parameters control the module's configuration. Most of the time, these parameters will not require any configuration or attention.

\n\n

The modules mentioned above, and other Apache modules that have templates, will cause template files to be dropped along with the mod install, and the module will not work without the template. Any mod without a template will install package but drop no files.

\n\n

Class: apache::mod::ssl

\n\n

Installs Apache SSL capabilities and utilizes ssl.conf.erb template. These are the defaults:

\n\n
    class { 'apache::mod::ssl':\n      ssl_compression => false,\n      ssl_options     => [ 'StdEnvVars' ],\n  }\n
\n\n

To use SSL with a virtual host, you must either set thedefault_ssl_vhost parameter in apache to 'true' or set the ssl parameter in apache::vhost to 'true'.

\n\n

Class: apache::mod::wsgi

\n\n
    class { 'apache::mod::wsgi':\n      wsgi_socket_prefix => "\\${APACHE_RUN_DIR}WSGI",\n      wsgi_python_home   => '/path/to/virtenv',\n      wsgi_python_path   => '/path/to/virtenv/site-packages',\n    }\n
\n\n

Defined Type: apache::vhost

\n\n

The Apache module allows a lot of flexibility in the set up and configuration of virtual hosts. This flexibility is due, in part, to vhost's setup as a defined resource type, which allows it to be evaluated multiple times with different parameters.

\n\n

The vhost defined type allows you to have specialized configurations for virtual hosts that have requirements outside of the defaults. You can set up a default vhost within the base apache class as well as set a customized vhost setup as default. Your customized vhost (priority 10) will be privileged over the base class vhost (15).

\n\n

If you have a series of specific configurations and do not want a base apache class default vhost, make sure to set the base class default host to 'false'.

\n\n
    class { 'apache':\n      default_vhost => false,\n    }\n
\n\n

Parameters within apache::vhost:

\n\n

The default values for each parameter will vary based on operating system and type of virtual host.

\n\n
access_log
\n\n

Specifies whether *_access.log directives should be configured. Valid values are 'true' and 'false'. Defaults to 'true'.

\n\n
access_log_file
\n\n

Points to the *_access.log file. Defaults to 'undef'.

\n\n
access_log_pipe
\n\n

Specifies a pipe to send access log messages to. Defaults to 'undef'.

\n\n
access_log_syslog
\n\n

Sends all access log messages to syslog. Defaults to 'undef'.

\n\n
access_log_format
\n\n

Specifies either a LogFormat nickname or custom format string for access log. Defaults to 'undef'.

\n\n
add_listen
\n\n

Determines whether the vhost creates a listen statement. The default value is 'true'.

\n\n

Setting add_listen to 'false' stops the vhost from creating a listen statement, and this is important when you combine vhosts that are not passed an ip parameter with vhosts that are passed the ip parameter.

\n\n
aliases
\n\n

Passes a list of hashes to the vhost to create Alias or AliasMatch statements as per the mod_alias documentation. Each hash is expected to be of the form:

\n\n
aliases => [\n  { aliasmatch => '^/image/(.*)\\.jpg$', path => '/files/jpg.images/$1.jpg' }\n  { alias      => '/image',             path => '/ftp/pub/image' },\n],\n
\n\n

For Alias and AliasMatch to work, each will need a corresponding <Directory /path/to/directory> or <Location /path/to/directory> block. The Alias and AliasMatch directives are created in the order specified in the aliases paramter. As described in the mod_alias documentation more specific Alias or AliasMatch directives should come before the more general ones to avoid shadowing.

\n\n

Note: If apache::mod::passenger is loaded and PassengerHighPerformance true is set, then Alias may have issues honouring the PassengerEnabled off statement. See this article for details.

\n\n
block
\n\n

Specifies the list of things Apache will block access to. The default is an empty set, '[]'. Currently, the only option is 'scm', which blocks web access to .svn, .git and .bzr directories. To add to this, please see the Development section.

\n\n
custom_fragment
\n\n

Pass a string of custom configuration directives to be placed at the end of the vhost configuration.

\n\n
default_vhost
\n\n

Sets a given apache::vhost as the default to serve requests that do not match any other apache::vhost definitions. The default value is 'false'.

\n\n
directories
\n\n

Passes a list of hashes to the vhost to create <Directory /path/to/directory>...</Directory> directive blocks as per the Apache core documentation. The path key is required in these hashes. An optional provider defaults to directory. Usage will typically look like:

\n\n
    apache::vhost { 'sample.example.net':\n      docroot     => '/path/to/directory',\n      directories => [\n        { path => '/path/to/directory', <directive> => <value> },\n        { path => '/path/to/another/directory', <directive> => <value> },\n      ],\n    }\n
\n\n

Note: At least one directory should match docroot parameter, once you start declaring directories apache::vhost assumes that all required <Directory> blocks will be declared.

\n\n

Note: If not defined a single default <Directory> block will be created that matches the docroot parameter.

\n\n

provider can be set to any of directory, files, or location. If the pathspec starts with a ~, httpd will interpret this as the equivalent of DirectoryMatch, FilesMatch, or LocationMatch, respectively.

\n\n
    apache::vhost { 'files.example.net':\n      docroot     => '/var/www/files',\n      directories => [\n        { path => '~ (\\.swp|\\.bak|~)$', 'provider' => 'files', 'deny' => 'from all' },\n      ],\n    }\n
\n\n

The directives will be embedded within the Directory (Files, or Location) directive block, missing directives should be undefined and not be added, resulting in their default vaules in Apache. Currently this is the list of supported directives:

\n\n
addhandlers
\n\n

Sets AddHandler directives as per the Apache Core documentation. Accepts a list of hashes of the form { handler => 'handler-name', extensions => ['extension']}. Note that extensions is a list of extenstions being handled by the handler.\nAn example:

\n\n
    apache::vhost { 'sample.example.net':\n      docroot     => '/path/to/directory',\n      directories => [ { path => '/path/to/directory',\n        addhandlers => [ { handler => 'cgi-script', extensions => ['.cgi']} ],\n      } ],\n    }\n
\n\n
allow
\n\n

Sets an Allow directive as per the Apache Core documentation. An example:

\n\n
    apache::vhost { 'sample.example.net':\n      docroot     => '/path/to/directory',\n      directories => [ { path => '/path/to/directory', allow => 'from example.org' } ],\n    }\n
\n\n
allow_override
\n\n

Sets the usage of .htaccess files as per the Apache core documentation. Should accept in the form of a list or a string. An example:

\n\n
    apache::vhost { 'sample.example.net':\n      docroot     => '/path/to/directory',\n      directories => [ { path => '/path/to/directory', allow_override => ['AuthConfig', 'Indexes'] } ],\n    }\n
\n\n
deny
\n\n

Sets an Deny directive as per the Apache Core documentation. An example:

\n\n
    apache::vhost { 'sample.example.net':\n      docroot     => '/path/to/directory',\n      directories => [ { path => '/path/to/directory', deny => 'from example.org' } ],\n    }\n
\n\n
error_documents
\n\n

A list of hashes which can be used to override the ErrorDocument settings for this directory. Example:

\n\n
    apache::vhost { 'sample.example.net':\n      directories => [ { path => '/srv/www'\n        error_documents => [\n          { 'error_code' => '503', 'document' => '/service-unavail' },\n        ],\n      }]\n    }\n
\n\n
headers
\n\n

Adds lines for Header directives as per the Apache Header documentation. An example:

\n\n
    apache::vhost { 'sample.example.net':\n      docroot     => '/path/to/directory',\n      directories => {\n        path    => '/path/to/directory',\n        headers => 'Set X-Robots-Tag "noindex, noarchive, nosnippet"',\n      },\n    }\n
\n\n
options
\n\n

Lists the options for the given <Directory> block

\n\n
    apache::vhost { 'sample.example.net':\n      docroot     => '/path/to/directory',\n      directories => [ { path => '/path/to/directory', options => ['Indexes','FollowSymLinks','MultiViews'] }],\n    }\n
\n\n
index_options
\n\n

Styles the list

\n\n
    apache::vhost { 'sample.example.net':\n      docroot     => '/path/to/directory',\n      directories => [ { path => '/path/to/directory', options => ['Indexes','FollowSymLinks','MultiViews'], index_options => ['IgnoreCase', 'FancyIndexing', 'FoldersFirst', 'NameWidth=*', 'DescriptionWidth=*', 'SuppressHTMLPreamble'] }],\n    }\n
\n\n
index_order_default
\n\n

Sets the order of the list

\n\n
    apache::vhost { 'sample.example.net':\n      docroot     => '/path/to/directory',\n      directories => [ { path => '/path/to/directory', order => 'Allow,Deny', index_order_default => ['Descending', 'Date']}, ],\n    }\n
\n\n
order
\n\n

Sets the order of processing Allow and Deny statements as per Apache core documentation. An example:

\n\n
    apache::vhost { 'sample.example.net':\n      docroot     => '/path/to/directory',\n      directories => [ { path => '/path/to/directory', order => 'Allow,Deny' } ],\n    }\n
\n\n
auth_type
\n\n

Sets the value for AuthType as per the Apache AuthType\ndocumentation.

\n\n
auth_name
\n\n

Sets the value for AuthName as per the Apache AuthName\ndocumentation.

\n\n
auth_digest_algorithm
\n\n

Sets the value for AuthDigestAlgorithm as per the Apache\nAuthDigestAlgorithm\ndocumentation

\n\n
auth_digest_domain
\n\n

Sets the value for AuthDigestDomain as per the Apache AuthDigestDomain\ndocumentation.

\n\n
auth_digest_nonce_lifetime
\n\n

Sets the value for AuthDigestNonceLifetime as per the Apache\nAuthDigestNonceLifetime\ndocumentation

\n\n
auth_digest_provider
\n\n

Sets the value for AuthDigestProvider as per the Apache AuthDigestProvider\ndocumentation.

\n\n
auth_digest_qop
\n\n

Sets the value for AuthDigestQop as per the Apache AuthDigestQop\ndocumentation.

\n\n
auth_digest_shmem_size
\n\n

Sets the value for AuthAuthDigestShmemSize as per the Apache AuthDigestShmemSize\ndocumentation.

\n\n
auth_basic_authoritative
\n\n

Sets the value for AuthBasicAuthoritative as per the Apache\nAuthBasicAuthoritative\ndocumentation.

\n\n
auth_basic_fake
\n\n

Sets the value for AuthBasicFake as per the Apache AuthBasicFake\ndocumentation.

\n\n
auth_basic_provider
\n\n

Sets the value for AuthBasicProvider as per the Apache AuthBasicProvider\ndocumentation.

\n\n
auth_user_file
\n\n

Sets the value for AuthUserFile as per the Apache AuthUserFile\ndocumentation.

\n\n
auth_require
\n\n

Sets the value for AuthName as per the Apache Require\ndocumentation

\n\n
passenger_enabled
\n\n

Sets the value for the PassengerEnabled directory to on or off as per the Passenger documentation.

\n\n
    apache::vhost { 'sample.example.net':\n      docroot     => '/path/to/directory',\n      directories => [ { path => '/path/to/directory', passenger_enabled => 'off' } ],\n    }\n
\n\n

Note: This directive requires apache::mod::passenger to be active, Apache may not start with an unrecognised directive without it.

\n\n

Note: Be aware that there is an issue using the PassengerEnabled directive with the PassengerHighPerformance directive.

\n\n
ssl_options
\n\n

String or list of SSLOptions for the given <Directory> block. This overrides, or refines the SSLOptions of the parent block (either vhost, or server).

\n\n
    apache::vhost { 'secure.example.net':\n      docroot     => '/path/to/directory',\n      directories => [\n        { path => '/path/to/directory', ssl_options => '+ExportCertData' }\n        { path => '/path/to/different/dir', ssl_options => [ '-StdEnvVars', '+ExportCertData'] },\n      ],\n    }\n
\n\n
suphp
\n\n

An array containing two values: User and group for the suPHP_UserGroup setting.\nThis directive must be used with suphp_engine => on in the vhost declaration. This directive only works in <Directory> or <Location>.

\n\n
    apache::vhost { 'secure.example.net':\n      docroot     => '/path/to/directory',\n      directories => [\n        { path => '/path/to/directory', suphp => { user =>  'myappuser', group => 'myappgroup' }\n      ],\n    }\n
\n\n
custom_fragment
\n\n

Pass a string of custom configuration directives to be placed at the end of the\ndirectory configuration.

\n\n
directoryindex
\n\n

Set a DirectoryIndex directive, to set the list of resources to look for, when the client requests an index of the directory by specifying a / at the end of the directory name..

\n\n
docroot
\n\n

Provides the DocumentRoot directive, identifying the directory Apache serves files from.

\n\n
docroot_group
\n\n

Sets group access to the docroot directory. Defaults to 'root'.

\n\n
docroot_owner
\n\n

Sets individual user access to the docroot directory. Defaults to 'root'.

\n\n
error_log
\n\n

Specifies whether *_error.log directives should be configured. Defaults to 'true'.

\n\n
error_log_file
\n\n

Points to the *_error.log file. Defaults to 'undef'.

\n\n
error_log_pipe
\n\n

Specifies a pipe to send error log messages to. Defaults to 'undef'.

\n\n
error_log_syslog
\n\n

Sends all error log messages to syslog. Defaults to 'undef'.

\n\n
error_documents
\n\n

A list of hashes which can be used to override the ErrorDocument settings for this vhost. Defaults to []. Example:

\n\n
    apache::vhost { 'sample.example.net':\n      error_documents => [\n        { 'error_code' => '503', 'document' => '/service-unavail' },\n        { 'error_code' => '407', 'document' => 'https://example.com/proxy/login' },\n      ],\n    }\n
\n\n
ensure
\n\n

Specifies if the vhost file is present or absent.

\n\n
fastcgi_server
\n\n

Specifies the filename as an external FastCGI application. Defaults to 'undef'.

\n\n
fastcgi_socket
\n\n

Filename used to communicate with the web server. Defaults to 'undef'.

\n\n
fastcgi_dir
\n\n

Directory to enable for FastCGI. Defaults to 'undef'.

\n\n
additional_includes
\n\n

Specifies paths to additional static vhost-specific Apache configuration files.\nThis option is useful when you need to implement a unique and/or custom\nconfiguration not supported by this module.

\n\n
ip
\n\n

The IP address the vhost listens on. Defaults to 'undef'.

\n\n
ip_based
\n\n

Enables an IP-based vhost. This parameter inhibits the creation of a NameVirtualHost directive, since those are used to funnel requests to name-based vhosts. Defaults to 'false'.

\n\n
logroot
\n\n

Specifies the location of the virtual host's logfiles. Defaults to /var/log/<apache log location>/.

\n\n
log_level
\n\n

Specifies the verbosity level of the error log. Defaults to warn for the global server configuration and can be overridden on a per-vhost basis using this parameter. Valid value for log_level is one of emerg, alert, crit, error, warn, notice, info or debug.

\n\n
no_proxy_uris
\n\n

Specifies URLs you do not want to proxy. This parameter is meant to be used in combination with proxy_dest.

\n\n
options
\n\n

Lists the options for the given virtual host

\n\n
    apache::vhost { 'site.name.fdqn':\n      …\n      options => ['Indexes','FollowSymLinks','MultiViews'],\n    }\n
\n\n
override
\n\n

Sets the overrides for the given virtual host. Accepts an array of AllowOverride arguments.

\n\n
port
\n\n

Sets the port the host is configured on.

\n\n
priority
\n\n

Sets the relative load-order for Apache httpd VirtualHost configuration files. Defaults to '25'.

\n\n

If nothing matches the priority, the first name-based vhost will be used. Likewise, passing a higher priority will cause the alphabetically first name-based vhost to be used if no other names match.

\n\n

Note: You should not need to use this parameter. However, if you do use it, be aware that the default_vhost parameter for apache::vhost passes a priority of '15'.

\n\n
proxy_dest
\n\n

Specifies the destination address of a proxypass configuration. Defaults to 'undef'.

\n\n
proxy_pass
\n\n

Specifies an array of path => uri for a proxypass configuration. Defaults to 'undef'.

\n\n

Example:

\n\n
$proxy_pass = [\n  { 'path' => '/a', 'url' => 'http://backend-a/' },\n  { 'path' => '/b', 'url' => 'http://backend-b/' },\n  { 'path' => '/c', 'url' => 'http://backend-a/c' }\n]\n\napache::vhost { 'site.name.fdqn':\n  …\n  proxy_pass       => $proxy_pass,\n}\n
\n\n
rack_base_uris
\n\n

Specifies the resource identifiers for a rack configuration. The file paths specified will be listed as rack application roots for passenger/rack in the _rack.erb template. Defaults to 'undef'.

\n\n
redirect_dest
\n\n

Specifies the address to redirect to. Defaults to 'undef'.

\n\n
redirect_source
\n\n

Specifies the source items? that will redirect to the destination specified in redirect_dest. If more than one item for redirect is supplied, the source and destination must be the same length, and the items are order-dependent.

\n\n
    apache::vhost { 'site.name.fdqn':\n      …\n      redirect_source => ['/images','/downloads'],\n      redirect_dest => ['http://img.example.com/','http://downloads.example.com/'],\n    }\n
\n\n
redirect_status
\n\n

Specifies the status to append to the redirect. Defaults to 'undef'.

\n\n
    apache::vhost { 'site.name.fdqn':\n      …\n      redirect_status => ['temp','permanent'],\n    }\n
\n\n
request_headers
\n\n

Specifies additional request headers.

\n\n
    apache::vhost { 'site.name.fdqn':\n      …\n      request_headers => [\n        'append MirrorID "mirror 12"',\n        'unset MirrorID',\n      ],\n    }\n
\n\n
rewrite_base
\n\n

Limits the rewrite_rule to the specified base URL. Defaults to 'undef'.

\n\n
    apache::vhost { 'site.name.fdqn':\n      …\n      rewrite_rule => '^index\\.html$ welcome.html',\n      rewrite_base => '/blog/',\n    }\n
\n\n

The above example would limit the index.html -> welcome.html rewrite to only something inside of http://example.com/blog/.

\n\n
rewrite_cond
\n\n

Rewrites a URL via rewrite_rule based on the truth of specified conditions. For example

\n\n
    apache::vhost { 'site.name.fdqn':\n      …\n      rewrite_cond => '%{HTTP_USER_AGENT} ^MSIE',\n    }\n
\n\n

will rewrite URLs only if the visitor is using IE. Defaults to 'undef'.

\n\n

Note: At the moment, each vhost is limited to a single list of rewrite conditions. In the future, you will be able to specify multiple rewrite_cond and rewrite_rules per vhost, so that different conditions get different rewrites.

\n\n
rewrite_rule
\n\n

Creates URL rewrite rules. Defaults to 'undef'. This parameter allows you to specify, for example, that anyone trying to access index.html will be served welcome.html.

\n\n
    apache::vhost { 'site.name.fdqn':\n      …\n      rewrite_rule => '^index\\.html$ welcome.html',\n    }\n
\n\n
scriptalias
\n\n

Defines a directory of CGI scripts to be aliased to the path '/cgi-bin'

\n\n
scriptaliases
\n\n

Passes a list of hashes to the vhost to create ScriptAlias or ScriptAliasMatch statements as per the mod_alias documentation. Each hash is expected to be of the form:

\n\n
    scriptaliases => [\n      {\n        alias => '/myscript',\n        path  => '/usr/share/myscript',\n      },\n      {\n        aliasmatch => '^/foo(.*)',\n        path       => '/usr/share/fooscripts$1',\n      },\n      {\n        aliasmatch => '^/bar/(.*)',\n        path       => '/usr/share/bar/wrapper.sh/$1',\n      },\n      {\n        alias => '/neatscript',\n        path  => '/usr/share/neatscript',\n      },\n    ]\n
\n\n

These directives are created in the order specified. As with Alias and AliasMatch directives the more specific aliases should come before the more general ones to avoid shadowing.

\n\n
serveradmin
\n\n

Specifies the email address Apache will display when it renders one of its error pages.

\n\n
serveraliases
\n\n

Sets the server aliases of the site.

\n\n
servername
\n\n

Sets the primary name of the virtual host.

\n\n
setenv
\n\n

Used by HTTPD to set environment variables for vhosts. Defaults to '[]'.

\n\n
setenvif
\n\n

Used by HTTPD to conditionally set environment variables for vhosts. Defaults to '[]'.

\n\n
ssl
\n\n

Enables SSL for the virtual host. SSL vhosts only respond to HTTPS queries. Valid values are 'true' or 'false'.

\n\n
ssl_ca
\n\n

Specifies the certificate authority.

\n\n
ssl_cert
\n\n

Specifies the SSL certification.

\n\n
ssl_protocol
\n\n

Specifies the SSL Protocol (SSLProtocol).

\n\n
ssl_cipher
\n\n

Specifies the SSLCipherSuite.

\n\n
ssl_honorcipherorder
\n\n

Sets SSLHonorCipherOrder directive, used to prefer the server's cipher preference order

\n\n
ssl_certs_dir
\n\n

Specifies the location of the SSL certification directory. Defaults to /etc/ssl/certs on Debian and /etc/pki/tls/certs on RedHat.

\n\n
ssl_chain
\n\n

Specifies the SSL chain.

\n\n
ssl_crl
\n\n

Specifies the certificate revocation list to use.

\n\n
ssl_crl_path
\n\n

Specifies the location of the certificate revocation list.

\n\n
ssl_key
\n\n

Specifies the SSL key.

\n\n
ssl_verify_client
\n\n

Sets SSLVerifyClient directives as per the Apache Core documentation. Defaults to undef.\nAn example:

\n\n
    apache::vhost { 'sample.example.net':\n      …\n      ssl_verify_client => 'optional',\n    }\n
\n\n
ssl_verify_depth
\n\n

Sets SSLVerifyDepth directives as per the Apache Core documentation. Defaults to undef.\nAn example:

\n\n
    apache::vhost { 'sample.example.net':\n      …\n      ssl_verify_depth => 1,\n    }\n
\n\n
ssl_options
\n\n

Sets SSLOptions directives as per the Apache Core documentation. This is the global setting for the vhost and can be a string or an array. Defaults to undef. A single string example:

\n\n
    apache::vhost { 'sample.example.net':\n      …\n      ssl_options => '+ExportCertData',\n    }\n
\n\n

An array of strings example:

\n\n
    apache::vhost { 'sample.example.net':\n      …\n      ssl_options => [ '+StrictRequire', '+ExportCertData' ],\n    }\n
\n\n
ssl_proxyengine
\n\n

Specifies whether to use SSLProxyEngine or not. Defaults to false.

\n\n
vhost_name
\n\n

This parameter is for use with name-based virtual hosting. Defaults to '*'.

\n\n
itk
\n\n

Hash containing infos to configure itk as per the ITK documentation.

\n\n

Keys could be:

\n\n\n\n

Usage will typically look like:

\n\n
    apache::vhost { 'sample.example.net':\n      docroot     => '/path/to/directory',\n      itk => {\n        user  => 'someuser',\n        group => 'somegroup',\n      },\n    }\n
\n\n

Virtual Host Examples

\n\n

The Apache module allows you to set up pretty much any configuration of virtual host you might desire. This section will address some common configurations. Please see the Tests section for even more examples.

\n\n

Configure a vhost with a server administrator

\n\n
    apache::vhost { 'third.example.com':\n      port        => '80',\n      docroot     => '/var/www/third',\n      serveradmin => 'admin@example.com',\n    }\n
\n\n
\n\n

Set up a vhost with aliased servers

\n\n
    apache::vhost { 'sixth.example.com':\n      serveraliases => [\n        'sixth.example.org',\n        'sixth.example.net',\n      ],\n      port          => '80',\n      docroot       => '/var/www/fifth',\n    }\n
\n\n
\n\n

Configure a vhost with a cgi-bin

\n\n
    apache::vhost { 'eleventh.example.com':\n      port        => '80',\n      docroot     => '/var/www/eleventh',\n      scriptalias => '/usr/lib/cgi-bin',\n    }\n
\n\n
\n\n

Set up a vhost with a rack configuration

\n\n
    apache::vhost { 'fifteenth.example.com':\n      port           => '80',\n      docroot        => '/var/www/fifteenth',\n      rack_base_uris => ['/rackapp1', '/rackapp2'],\n    }\n
\n\n
\n\n

Set up a mix of SSL and non-SSL vhosts at the same domain

\n\n
    #The non-ssl vhost\n    apache::vhost { 'first.example.com non-ssl':\n      servername => 'first.example.com',\n      port       => '80',\n      docroot    => '/var/www/first',\n    }\n\n    #The SSL vhost at the same domain\n    apache::vhost { 'first.example.com ssl':\n      servername => 'first.example.com',\n      port       => '443',\n      docroot    => '/var/www/first',\n      ssl        => true,\n    }\n
\n\n
\n\n

Configure a vhost to redirect non-SSL connections to SSL

\n\n
    apache::vhost { 'sixteenth.example.com non-ssl':\n      servername      => 'sixteenth.example.com',\n      port            => '80',\n      docroot         => '/var/www/sixteenth',\n      redirect_status => 'permanent'\n      redirect_dest   => 'https://sixteenth.example.com/'\n    }\n    apache::vhost { 'sixteenth.example.com ssl':\n      servername => 'sixteenth.example.com',\n      port       => '443',\n      docroot    => '/var/www/sixteenth',\n      ssl        => true,\n    }\n
\n\n
\n\n

Set up IP-based vhosts on any listen port and have them respond to requests on specific IP addresses. In this example, we will set listening on ports 80 and 81. This is required because the example vhosts are not declared with a port parameter.

\n\n
    apache::listen { '80': }\n    apache::listen { '81': }\n
\n\n

Then we will set up the IP-based vhosts

\n\n
    apache::vhost { 'first.example.com':\n      ip       => '10.0.0.10',\n      docroot  => '/var/www/first',\n      ip_based => true,\n    }\n    apache::vhost { 'second.example.com':\n      ip       => '10.0.0.11',\n      docroot  => '/var/www/second',\n      ip_based => true,\n    }\n
\n\n
\n\n

Configure a mix of name-based and IP-based vhosts. First, we will add two IP-based vhosts on 10.0.0.10, one SSL and one non-SSL

\n\n
    apache::vhost { 'The first IP-based vhost, non-ssl':\n      servername => 'first.example.com',\n      ip         => '10.0.0.10',\n      port       => '80',\n      ip_based   => true,\n      docroot    => '/var/www/first',\n    }\n    apache::vhost { 'The first IP-based vhost, ssl':\n      servername => 'first.example.com',\n      ip         => '10.0.0.10',\n      port       => '443',\n      ip_based   => true,\n      docroot    => '/var/www/first-ssl',\n      ssl        => true,\n    }\n
\n\n

Then, we will add two name-based vhosts listening on 10.0.0.20

\n\n
    apache::vhost { 'second.example.com':\n      ip      => '10.0.0.20',\n      port    => '80',\n      docroot => '/var/www/second',\n    }\n    apache::vhost { 'third.example.com':\n      ip      => '10.0.0.20',\n      port    => '80',\n      docroot => '/var/www/third',\n    }\n
\n\n

If you want to add two name-based vhosts so that they will answer on either 10.0.0.10 or 10.0.0.20, you MUST declare add_listen => 'false' to disable the otherwise automatic 'Listen 80', as it will conflict with the preceding IP-based vhosts.

\n\n
    apache::vhost { 'fourth.example.com':\n      port       => '80',\n      docroot    => '/var/www/fourth',\n      add_listen => false,\n    }\n    apache::vhost { 'fifth.example.com':\n      port       => '80',\n      docroot    => '/var/www/fifth',\n      add_listen => false,\n    }\n
\n\n

Implementation

\n\n

Classes and Defined Types

\n\n

Class: apache::dev

\n\n

Installs Apache development libraries

\n\n
    class { 'apache::dev': }\n
\n\n

On FreeBSD you're required to define apache::package or apache class before apache::dev.

\n\n

Defined Type: apache::listen

\n\n

Controls which ports Apache binds to for listening based on the title:

\n\n
    apache::listen { '80': }\n    apache::listen { '443': }\n
\n\n

Declaring this defined type will add all Listen directives to the ports.conf file in the Apache httpd configuration directory. apache::listen titles should always take the form of: <port>, <ipv4>:<port>, or [<ipv6>]:<port>

\n\n

Apache httpd requires that Listen directives must be added for every port. The apache::vhost defined type will automatically add Listen directives unless the apache::vhost is passed add_listen => false.

\n\n

Defined Type: apache::namevirtualhost

\n\n

Enables named-based hosting of a virtual host

\n\n
    class { 'apache::namevirtualhost`: }\n
\n\n

Declaring this defined type will add all NameVirtualHost directives to the ports.conf file in the Apache https configuration directory. apache::namevirtualhost titles should always take the form of: *, *:<port>, _default_:<port>, <ip>, or <ip>:<port>.

\n\n

Defined Type: apache::balancermember

\n\n

Define members of a proxy_balancer set (mod_proxy_balancer). Very useful when using exported resources.

\n\n

On every app server you can export a balancermember like this:

\n\n
      @@apache::balancermember { "${::fqdn}-puppet00":\n        balancer_cluster => 'puppet00',\n        url              => "ajp://${::fqdn}:8009"\n        options          => ['ping=5', 'disablereuse=on', 'retry=5', 'ttl=120'],\n      }\n
\n\n

And on the proxy itself you create the balancer cluster using the defined type apache::balancer:

\n\n
      apache::balancer { 'puppet00': }\n
\n\n

If you need to use ProxySet in the balncer config you can do as so:

\n\n
      apache::balancer { 'puppet01':\n        proxy_set => {'stickysession' => 'JSESSIONID'},\n      }\n
\n\n

Templates

\n\n

The Apache module relies heavily on templates to enable the vhost and apache::mod defined types. These templates are built based on Facter facts around your operating system. Unless explicitly called out, most templates are not meant for configuration.

\n\n

Limitations

\n\n

This has been tested on Ubuntu Precise, Debian Wheezy, CentOS 5.8, and FreeBSD 9.1.

\n\n

Development

\n\n

Overview

\n\n

Puppet Labs modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can’t access the huge number of platforms and myriad of hardware, software, and deployment configurations that Puppet is intended to serve.

\n\n

We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.

\n\n

You can read the complete module contribution guide on the Puppet Labs wiki.

\n\n

Running tests

\n\n

This project contains tests for both rspec-puppet and rspec-system to verify functionality. For in-depth information please see their respective documentation.

\n\n

Quickstart:

\n\n
gem install bundler\nbundle install\nbundle exec rake spec\nbundle exec rake spec:system\n
\n\n

Copyright and License

\n\n

Copyright (C) 2012 Puppet Labs Inc

\n\n

Puppet Labs can be contacted at: info@puppetlabs.com

\n\n

Licensed under the Apache License, Version 2.0 (the "License");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at

\n\n

http://www.apache.org/licenses/LICENSE-2.0

\n\n

Unless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.

\n
", "changelog": "

2013-12-05 Release 0.10.0

\n\n

Summary:

\n\n

This release adds FreeBSD osfamily support and various other improvements to some mods.

\n\n

Features:

\n\n\n\n

Bugfixes:

\n\n\n\n

2013-09-06 Release 0.9.0

\n\n

Summary:

\n\n

This release adds more parameters to the base apache class and apache defined\nresource to make the module more flexible. It also adds or enhances SuPHP,\nWSGI, and Passenger mod support, and support for the ITK mpm module.

\n\n

Backwards-incompatible Changes:

\n\n\n\n

Features:

\n\n\n\n

Bugfixes:

\n\n\n\n

2013-07-26 Release 0.8.1

\n\n

Bugfixes:

\n\n\n\n

2013-07-16 Release 0.8.0

\n\n

Features:

\n\n\n\n

Bugfixes:

\n\n\n\n

2013-07-09 Release 0.7.0

\n\n

Changes:

\n\n\n\n

Bugfixes:

\n\n\n\n

2013-03-2 Release 0.6.0

\n\n\n\n

2012-08-24 Release 0.4.0

\n\n

Changes:

\n\n\n\n

Bugfixes:

\n\n\n
", "license": "
Copyright (C) 2012 Puppet Labs Inc\n\nPuppet Labs can be contacted at: info@puppetlabs.com\n\nLicensed under the Apache License, Version 2.0 (the "License");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n
", "created_at": "2013-12-05 15:29:14 -0800", "updated_at": "2013-12-05 15:29:14 -0800", "deleted_at": null }, "releases": [ { "uri": "/v3/releases/puppetlabs-apache-0.10.0", "version": "0.10.0" }, { "uri": "/v3/releases/puppetlabs-apache-0.9.0", "version": "0.9.0" }, { "uri": "/v3/releases/puppetlabs-apache-0.8.1", "version": "0.8.1" }, { "uri": "/v3/releases/puppetlabs-apache-0.8.0", "version": "0.8.0" }, { "uri": "/v3/releases/puppetlabs-apache-0.7.0", "version": "0.7.0" }, { "uri": "/v3/releases/puppetlabs-apache-0.6.0", "version": "0.6.0" }, { "uri": "/v3/releases/puppetlabs-apache-0.5.0-rc1", "version": "0.5.0-rc1" }, { "uri": "/v3/releases/puppetlabs-apache-0.4.0", "version": "0.4.0" }, { "uri": "/v3/releases/puppetlabs-apache-0.3.0", "version": "0.3.0" }, { "uri": "/v3/releases/puppetlabs-apache-0.2.2", "version": "0.2.2" }, { "uri": "/v3/releases/puppetlabs-apache-0.2.1", "version": "0.2.1" }, { "uri": "/v3/releases/puppetlabs-apache-0.2.0", "version": "0.2.0" }, { "uri": "/v3/releases/puppetlabs-apache-0.1.1", "version": "0.1.1" }, { "uri": "/v3/releases/puppetlabs-apache-0.0.4", "version": "0.0.4" }, { "uri": "/v3/releases/puppetlabs-apache-0.0.3", "version": "0.0.3" }, { "uri": "/v3/releases/puppetlabs-apache-0.0.2", "version": "0.0.2" }, { "uri": "/v3/releases/puppetlabs-apache-0.0.1", "version": "0.0.1" } ], "homepage_url": "https://github.com/puppetlabs/puppetlabs-apache", "issues_url": "https://tickets.puppetlabs.com" }