AMZ ami的主厨,重启失败,httpd停止启动httpd:地址已经在使用中

时间:2016-11-16 20:07:35

标签: apache amazon-web-services aws-opsworks

我通过ops工作在Amazon AMI图像上实现一个厨师脚本。我的目标是插入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

我尝试过多种变体,但它似乎总是在关机完成之前就开始了吗?

非常感谢任何帮助。

感谢。

迈尔斯。

1 个答案:

答案 0 :(得分:0)

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

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