AMAZON ami 上的 Chef,重启失败,httpd 已停止启动 httpd:地址已在使用中

Chef on AMZ ami, restart fails with httpd is stopped Starting httpd: Address already in use

我正在通过 ops works 在 Amazon AMI 图像上实现一个 chef 脚本。我的目标是插入 httpd.conf 和一个 conf.d/wa.conf 以在端口 8889 上设置站点。然后使用新配置重新启动 apache。

但是,当我尝试重新启动时出现以下错误:

STDOUT: Stopping httpd: [  OK  ] 
httpd is stopped
Starting httpd: [FAILED]
STDERR: (98)Address already in use: make_sock: could not bind to address 0.0.0.0:8889
no listening sockets available, shutting down
Unable to open logs
End output of     service httpd stop
---- 

我尝试了多种配置,但似乎都失败了。当我在配置失败后登录到盒子时,端口 8889 未被使用。那时我可以手动启动 httpd,但它仍然失败。

厨师脚本如下:

service 'httpd' do
  supports :status => true, :start => true, :stop => true, :restart => true
  action [:nothing]
end


template "/etc/httpd/conf/httpd.conf" do
  source 'httpd.conf.erb'
  action :create
  notifies :restart, 'service[httpd]'
end

我尝试了多种变体,但它似乎总是在关机完成之前启动?

如有任何帮助,我们将不胜感激。

谢谢。

迈尔斯.

由于某种原因无法使用端口 8889。

我将服务器切换到另一个端口,它工作正常。