Home > Net >  How to add my own custom configuration OUTSIDE a virtual host in apache httpd using puppet
How to add my own custom configuration OUTSIDE a virtual host in apache httpd using puppet

Time:11-10

I can use puppet to set up my apache httpd and add virtual hosts and load needed modules. I also know how to add custom configuration within a virtual host using the customconf-value but...

How do I configure in my pp-file to add my custom configuration in the main server config context? (I.e. outside of the virtual hosts)

I am using the standard apache module in puppet https://github.com/puppetlabs/puppetlabs-apache I have read the documentation several times and also tried following the broken links to for example apache::mod documentation (to see if there is some similar value like customconf but... with no success).

CodePudding user response:

How do I configure in my pp-file to add my custom configuration in the main server config context? (I.e. outside of the virtual hosts)

The reference documentation for the module is here: https://github.com/puppetlabs/puppetlabs-apache/blob/main/REFERENCE.md, or you can access it via the Forge here: https://forge.puppet.com/modules/puppetlabs/apache/reference.

Those document the plethora of parameters of the apache class, which expose a wide variety of Apache's configuration properties. You can manage most of the most common (and many of the less common) Apache configuration details by setting appropriate values for these class parameters.

They also document a plethora of classes that you can declare to adjust which modules are enabled, plus a native resource type (a2mod) and a defined-type wrapper apache::mod that you can use to configure modules that do not have a pre-built class.

And they document several public defined types that you can use to customize your configuration (including, but not limited to, vhosts). Of these, apache::custom_config is the most general, as it allows you to manage drop-in files containing more-or-less arbitrary Apache configuration.

  • Related