2014-10-31 97 views
0

我遵循Opscode Youtube視頻中的步驟來創建apache食譜。Apache食譜無法啓動

~/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 

但廚師客戶端失敗。

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)

+0

不知道你正在使用哪個操作系統,但如果它的rhel基於這可能是? https://github.com/svanzoest-cookbooks/apache2/issues/342 – 2015-04-30 20:20:39

回答

1

其他的東西已經在端口80上聽(Address already in use)。您可以使用命令sudo netstat -ltnp來檢查它是什麼。

+0

我不太確定我的狀態是否正確,我執行了命令,端口80是tcp(?) – user4136080 2014-10-31 04:35:28