2014-10-31 99 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