I have followed the steps from Opscode Youtube video to create apache cookbook.
~/chef-repo/cookbooks/apache/recipes/default.rb
package "apache2" do
action :install
end
service "apache2" do
action [:enable, :start]
end
cookbook_file "/var/www/index.html" do
source "index.html"
mode "0644"
end
but chef-client failed.
Running handlers: [2014-10-31T10:58:27+08:00] ERROR: Running exception handlers Running handlers complete [2014-10-31T10:58:27+08:00] ERROR: Exception handlers complete [2014-10-31T10:58:27+08:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-sta cktrace.out Chef Client failed. 0 resources updated in 1.137832751 seconds [2014-10-31T10:58:27+08:00] ERROR: service[apache2] (apache::default line 14) ha d an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1' ---- Begin output of /etc/init.d/apache2 start ---- STDOUT: * Starting web server apache2 Action 'start' failed. The Apache error log may have more information. ...fail! STDERR: (98)Address already in use: make_sock: could not bind to address 0.0.0.0 :80 no listening sockets available, shutting down Unable to open logs ---- End output of /etc/init.d/apache2 start ---- Ran /etc/init.d/apache2 start returned 1 [2014-10-31T10:58:27+08:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef ru n process exited unsuccessfully (exit code 1)