Product SiteDocumentation Site

13.3. Implementation

13.3.1. Managed Files and Directories

The webserver module manages the following files and directories, recursively:
  • /etc/httpd/conf/httpd.conf
    This file is the configuration file used when the webserver starts. It imports all files that are matched by the expression *.conf in /etc/httpd/modules-enabled/, as well as all files in /etc/httpd/sites-enabled/. Additionally, it imports all files in /etc/httpd/configs.d/, which holds some of the default configuration you might normally find in /etc/httpd/conf/httpd.conf, but that can be shared amongst different hosts in your environment.
  • /etc/httpd/sites-enabled/
    This directory holds all VirtualHosts configured for this webserver (by using the custom webserver::virtualhost type provided by the webserver module), on a file per ServerName basis.
  • /etc/httpd/modules-enabled/
    This directory holds all the modules configured for this webserver (by using the webserver::module type provided with the webserver module), and uses the package name to both install the required packages, as well as source and place the configuration file for that module.
  • /etc/httpd/includes.d/
    Some modules (like, all of them), place their default configuration files inside this directory. The webserver module purges these.
  • /etc/httpd/configs.d/
    Some modules (like, all of them), place their default configuration files inside the conf.d/ directory. Because the only way to load these modules from a global configuration file is to Include conf.d/*.conf, the webserver module uses a differrent directory for configuration files managed by Puppet. Imagine the following scenario:
    • You include Listen 443 in listen.conf.
    • You install mod_ssl, which puts a ssl.conf file in conf.d/. This file also contains Listen 443.
    • Restarting the webserver at this point will fail, because of the duplicate Listen 443 statement.
    There is no sustainable way Puppet can be told to purge the ssl.conf, because it does not have the same name as the package used to install mod_ssl with. There is also no sustainable way to tell Puppet to first apply everything in terms of package management, and then to purge conf.d/, because the webserver module for Puppet simply can't know what RPMs you do or do not want. And no, Puppet cannot require tagged resources from within another resource either.