我正在玩一个流浪的 Centos 6.4 盒子,
这是我的 Vagrantfile 的相关部分
config.vm.provision :chef_solo do |chef|
chef.json = {
"apache" => {
"listen_address" => "0.0.0.0",
"server_name" => "localhost", # ?? this doesn't work
},
}
chef.add_recipe "yum"
chef.add_recipe "selinux::disabled"
chef.add_recipe "vim"
# chef.add_recipe "openssl"
chef.add_recipe "apache2"
chef.add_recipe "php"
chef.add_recipe "php::module_curl"
chef.add_recipe "php::module_mysql"
chef.add_recipe "apache2::mod_php5"
chef.add_recipe "apache2::mod_rewrite"
chef.add_recipe "my"
end
不幸的是,当我这样做时,vagrant provision
我得到了一些错误,因为 apache 无法正常启动。错误是httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
如果我这样做了,vagrant ssh
那么我可以将其添加ServerName localhost
到 httpd.conf (/var/httpd/conf/httpd.conf) 并且 httpd 服务可以正常启动。
如何将其添加为属性chef.json
?