1

Currently I'm attempting to update my Vagrant machine with Puppet modules to PHP7, and ofcourse, with updated modules. However since updating the puppetlabs/apache module to version 3.0.0, it is failing when it's trying to install libapache2-mod-php7.0.

I've already been able to track it down to the cause. For some reason, the puppetlabs/apache module is setting two MPM's when the ::apache::mod::php class is being called. It sets both the event as the prefork MPM. The reason prefork is being set, is because the Puppet module requires you to either load the prefork or itk module when using PHP. When I define either prefork or itk, it also loads the event MPM for some reason. As of now, this is how I call the apache module:

class { '::apache':
    default_vhost    => false,
    mpm_module       => 'false',
    server_signature => 'Off',
}

class { '::apache::mod::ssl': }
class { '::apache::mod::prefork': }
class { '::apache::mod::php': }
class { '::apache::mod::rewrite': }
class { '::apache::mod::headers': }

When I set mpm_module to anything other than itk or prefork, it generates the error itk or prefork is mandatory. When I remove ::apache::mod::prefork and set the mpm_module setting to prefork, the same happens as with the current config.

When I ssh in to the Vagrant machine after the installation failed, and remove the LoadModule line in the /etc/apache2/modules-enabled/event.load file, everything works as expected. I have no idea why it is loading the event MPM, as the double MPM load is causing the conflict. Apache has no idea which MPM to load, thus fails on installation of the libapache2-mod-php7.0 installation.

There is also no output of Puppet that shows the event.conf/event.load files are created, only the prefork ones.

Notice: /Stage[main]/Apache::Mod::Prefork/Apache::Mpm[prefork]/File[/etc/apache2/mods-available/prefork.load]/ensure: defined content as '{md5}01b33d643f63126888cf702689f1f66d'
Notice: /Stage[main]/Apache::Mod::Prefork/Apache::Mpm[prefork]/File[/etc/apache2/mods-enabled/prefork.conf]/ensure: created
Notice: /Stage[main]/Apache::Mod::Prefork/Apache::Mpm[prefork]/File[/etc/apache2/mods-enabled/prefork.load]/ensure: created

I'm running it on Debian Stretch x64, with the latest stable release of Vagrant, VirtualBox, Puppet and Apache/2.4.25.

  • 1
    try to remove the class { '::apache::mod::prefork': } and use mpm_module => 'prefork' – c4f4t0r Feb 21 '18 at 10:52
  • "When I remove ::apache::mod::prefork and set the mpm_module setting to prefork, the same happens as with the current config." – WesselV Feb 21 '18 at 11:14
  • but why you don't show the output when you get the error? – c4f4t0r Feb 21 '18 at 11:23
  • Because the output of the error is irrelevant, it's caused by the fact Apache is somewhere being given both the event and prefork MPM. I was able to track it down to this cause when I ran apache2ctl checkconf. It's not giving any errors until it's actually trying to process the PHP mod, because of the two MPM's. – WesselV Feb 21 '18 at 11:50
1

For those interested, I opened a bug report in Puppetlabs' Jira, and as expected it turned out to be an actual bug. It should be fixes in a next release when the pull request goes through: https://tickets.puppetlabs.com/browse/MODULES-6677

I guess that solves this issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.