5

I'm using the puppetlabs apache module to manage my apache configuration.

I got everything configured, except the Server settings for mod_prefork. There is a template for prefork and it gets variable when initializing the class somehow, but I'm not exactly sure how.

I don't want to change the server settings in the template by hand, because I run apache on multiple hosts and don't want to change the value in the template itself.

Do you have any idea how to do that? The link to the module is here.

I had a read through the docs, but I'm unable to figure out how to do it.

1
  • im not sure how the usefulness of these comprehensive puppet mods compares with the simplicity of one or two core_conf "file" directives, for httpd.conf and its includes (or in my case nginx.conf and inclds)
    – nandoP
    Nov 14, 2013 at 2:42

2 Answers 2

6

You can set mpm_module to false, to explicitly declare the prefork-class with custom parameters afterwards.

class {
  'apache':
    mpm_module      => false,
}
class {
  'apache::mod::prefork':
    startservers    => "5",
    minspareservers => "3",
    maxspareservers => "3",
    serverlimit     => "64",
    maxclients      => "64",
}
5

The settings in prefork.conf are controlled by class parameters set on the apache::mod::prefork class. See manifests/mod/prefork.pp for these parameters and their defaults.

How you will set these depends on how you're actually declaring the apache class. Looks like it's actually a bit difficult if you're starting with class { 'apache': }, since it simply declares apache::mod::prefork with no way to pass parameters through. I'd recommend using Hiera for your node definitions, then setting up the params in your Hiera config, for example: apache::mod::prefork::maxclients: 256

You must log in to answer this question.