Product SiteDocumentation Site

13.3.2. Classes and Resources

To this end, the webserver module exposes the following resources:
Classes
  • webserver
    Installs the webserver application along with the directory tree and enabled modules (stock modules).
Types
  • webserver::configdfile
    Place a file $name.conf in /etc/httpd/configs.d/. This file is included by httpd.conf using a wildcard match (configs.d/*.conf), and thus configuration in such file applies globally.
  • webserver::includedfile
    Place a file $name.conf in /etc/httpd/includes.d/. This file can then be included manually. Useful for shared configuration files, such as LDAP Authentication settings that you want to be the same over all VirtualHosts, for example. Or, if you want one or two VirtualHosts to share the same Alias, set of RewriteRules, LocationMatch, Directory blocks, etc., etc.
  • webserver::module::enable
    Enables the selected module, whether it's a stock module, a module from a package or an application.
    1. Installs the required packages for the module requested, if any packages are required at all, and if the packages are available from the repositories configured (or already installed on the system).
    2. Sources the appropriate default module file to /etc/httpd/modules-enabled/module_package_name.conf, or /etc/httpd/configs.d/module_name.conf for applications, where module_package_name is the name of the package providing the module, and module_name is the name of the application (such as the application module cobbler).
    3. Notifies the httpd service to be reloaded after the puppet run completes, if any files have been changed.
  • webserver::module::disable
    Disables the selected module, whether it's a stock module, a module from a package or an application.
    1. Removes the packages related to the module, if any.
    2. Removes /etc/httpd/modules-enabled/module_package_name.conf, or /etc/httpd/configs.d/module_name.conf for applications, where module_package_name is the name of the package providing the module, and module_name is the name of the application (such as the application module cobbler).
    3. Notifies the httpd service to be reloaded after the puppet run completes, if any files have been changed.
  • webserver::virtualhost
    • Using templates
      To use a template for the virtualhost, call webserver::virtualhost with the template attribute:
      template => "webserver/path/to/template"
      
      If template is not specified, since it defaults to false, a normal source file will be attempted. See Using files for more information.
    • Using files
      1. Sources the appropriate default configuration file to /etc/httpd/sites-enabled/virtualhost_servername.conf, where virtualhost_servername is actually the title of the resource when you make the call to webserver::virtualhost, and should correspond with the ServerName directive used in the actual VirtualHost configuration block.
      2. Notifies the httpd service to be reloaded after the puppet run completes.
  • webserver::webapplication::mediawiki
    Mediawiki requires several other modules such as php and MySQL. To this end, the webserver::webapplication class defines a mediawiki type, that pulls in and configures the dependencies so you do not have to configure them manually.
    The webserver::webapplication::mediawiki type is in the webserver::webapplication sub-class of webserver, so that it can override the parameters defined with the resources instantiated in the webserver class.
    The webserver::webapplication::mediawiki type is a type -and not a class-, so you can define more then one mediawiki instance running on the same webserver.