使用Chef在预工作模式下启用apache2
我正在尝试使用Chef Solo将apache2和php安装在一个流浪者盒子(Ubuntu14.04)中。这是我的食谱:使用Chef在预工作模式下启用apache2,apache,ubuntu,vagrant,chef-solo,Apache,Ubuntu,Vagrant,Chef Solo,我正在尝试使用Chef Solo将apache2和php安装在一个流浪者盒子(Ubuntu14.04)中。这是我的食谱: include_recipe "apache2" include_recipe "apache2::mod_rewrite" include_recipe "apache2::mod_ssl" include_recipe "apache2::mod_php5" ### some changes due to php5 reqs. ### #----------------
include_recipe "apache2"
include_recipe "apache2::mod_rewrite"
include_recipe "apache2::mod_ssl"
include_recipe "apache2::mod_php5"
### some changes due to php5 reqs. ###
#-------------------------------------
apache_module "mpm_event" do
enable false
end
apache_module "mpm_prefork" do
enable true
end
service "apache2" do
action :restart
end
这是因为apache2在默认情况下安装了mpm_事件,我需要更改它,因为php
由于某些原因,这并不总是有效的(有时,apache2不会重新启动,因为mpm_事件仍然处于启用状态),因此我正在寻找一种更惯用、更安全的方法,使用prefork模块而不是事件直接安装apache2
有办法吗?可以在vagrant文件中设置mpm
config.vm.provision "chef_solo" do |chef|
chef.json = {
"apache" => {
"mpm" => "prefork"
}
}
end