gpt4 book ai didi

apache - 使用 Puppet 和 Vagrant 配置 Apache

转载 作者:行者123 更新时间:2023-12-01 23:18:07 24 4
gpt4 key购买 nike

我第一次在项目中使用 Vagrant 和 Puppet,但我一直遇到问题。

我使用 PuPHPet 作为起点,我的 default.pp list 中有以下片段:

class { 'apache': }

apache::dotconf { 'custom':
content => 'EnableSendfile Off',
}

apache::module { 'rewrite': }

apache::vhost { 'awesome.dev':
server_name => 'awesome.dev',
serveraliases => [
],
docroot => '/var/www',
port => '80',
directories => [ { path => '/var/www/', allow => 'from all', allow_override => ['All'] } ],
env_variables => [],
priority => '1',
}

当我运行它时,我总是得到以下错误:

warning: Could not retrieve fact fqdn
Invalid parameter directories at /tmp/vagrant-puppet/manifests/default.pp:46 on node precise32
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

cd /tmp/vagrant-puppet/manifests && puppet apply --verbose --modulepath '/etc/puppet/modules:/tmp/vagrant-puppet/modules-0' default.pp --detailed-exitcodes || [ $? -eq 2 ]

第 46 行是 apache::vhost 规则的结尾。我想将其设置为允许使用 htaccess 覆盖,但我看不出哪里出错了。谁能看出是什么问题?

最佳答案

PuPHPet 使用 Example42 Apache Puppet 模块,请参阅 README 文件。此模块在 vhost 资源中没有目录参数:

https://github.com/puphpet/puphpet-apache/blob/master/manifests/vhost.pp#L100

只有 Puppet Labs Apache 模块有目录参数,但它是一个不同的模块:

https://github.com/puppetlabs/puppetlabs-apache/blob/master/manifests/vhost.pp#L25

然而,您可以在 Example42 的模块中使用目录参数,类似于可以在 vhost 资源中找到的示例:

#  apache::vhost { 'my.other.site':
# docroot => '/path/to/docroot',
# directory => '/path/to',
# directory_allow_override => 'All',
# }

关于apache - 使用 Puppet 和 Vagrant 配置 Apache,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18054423/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com