Vagrant 和 Puppetlabs/apache 设置两个 MPM

Vagrant 和 Puppetlabs/apache 设置两个 MPM

目前,我正尝试将带有 Puppet 模块的 Vagrant 机器更新到 PHP7,当然,还更新了模块。但是,自从将 puppetlabs/apache 模块更新到版本 3.0.0 后,它在尝试安装时失败了libapache2-mod-php7.0

我已经能够追踪到原因。出于某种原因,puppetlabs/apache 模块在::apache::mod::php调用类时设置了两个 MPM。它将事件都设置为 prefork MPM。设置 prefork 的原因是因为 Puppet 模块要求您在使用 PHP 时加载 prefork 或 itk 模块。当我定义 prefork 或 itk 时,出于某种原因,它还会加载事件 MPM。到目前为止,我是这样调用 apache 模块的:

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': }

当我将 mpm_module 设置为 itk 或 prefork 以外的任何值时,它会生成错误 itk 或 prefork 是强制性的。当我删除::apache::mod::preforkmpm_module 设置并将其设置为 prefork 时,会发生与当前配置相同的情况。

安装失败后,当我通过 ssh 登录 Vagrant 计算机并删除文件中的 LoadModule 行时/etc/apache2/modules-enabled/event.load,一切都按预期工作。我不知道它为什么要加载事件 MPM,因为双重 MPM 加载会导致冲突。Apache 不知道要加载哪个 MPM,因此在安装 libapache2-mod-php7.0 时失败。

Puppet 的输出也没有显示已创建 event.conf/event.load 文件,只有 prefork 文件。

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

我在 Debian Stretch x64 上运行它,其中包含 Vagrant、VirtualBox、Puppet 和 Apache/2.4.25 的最新稳定版本。

答案1

对于那些感兴趣的人,我在 Puppetlabs 的 Jira 中打开了一个错误报告,正如预期的那样,它实际上是一个错误。当拉取请求通过时,它应该会在下一个版本中得到修复:https://tickets.puppetlabs.com/browse/MODULES-6677

我想这可以解决这个问题。

相关内容