我使用chef_solo
使用bento/centos7.2
配置了一个流浪者vm。我使用以下代码通过httpd cookbook安装httpd
。
# Install Apache and starts it
httpd_service 'mine' do
mpm 'prefork'
action [:create, :start]
listen_ports ['80', '443']
run_user node['webserver']['run_user'] # the value is 'vagrant'
end
# Add the site configuration
httpd_config 'mine' do
instance 'mine'
source 'mine.conf.erb'
notifies :restart, 'httpd_service[mine]'
end
# Create document rood directory
directory "#{node['webserver']['document_root']}" do
recursive true
end
# Homepage
template "#{node['webserver']['document_root']}/index.php" do
source 'index.php.erb'
mode '0644'
owner node['webserver']['user']
group node['webserver']['group']
action :create_if_missing
end
# Install the mod_php Apache module.
httpd_module 'php' do
instance 'mine'
end
# Install memcached
package 'memcached'
# Install php-pecl-memcache
package 'php-pecl-memcache' do
action :install
notifies :restart, 'httpd_service[mine]'
end
# Install php-pecl-memcached
package 'php-pecl-memcached' do
action :install
notifies :restart, 'httpd_service[mine]'
end
# Install php-mysql
package 'php-mysql' do
action :install
notifies :restart, 'httpd_service[mine]'
end
# Install php-pdo
package 'php-pdo' do
action :install
notifies :restart, 'httpd_service[mine]'
end
# Install php-intl
package 'php-intl' do
action :install
notifies :restart, 'httpd_service[mine]'
end
# Install php-mssql
package 'php-mssql' do
action :install
notifies :restart, 'httpd_service[mine]'
end
有趣的是,当我运行kitchen converge
时,一切都很好,httpd
完美无缺(InSpec测试通过,我手动验证kitchen login
)。
但是当我在流浪汉上奔跑时,它从一开始就被杀死,并在每次请求后死亡。我不知道为什么,也不知道是否有任何我可以读取的日志来调试此行为。有什么想法吗?
UDPATE:
在/var/log/httpd-mine/error_log
中找到了{p> This is the log
sudo journalctl
中的