From 654533a79d2177b63957e08e59e04ebfb300b5e0 Mon Sep 17 00:00:00 2001 From: Mark Vanderwiel Date: Fri, 8 Apr 2016 10:48:02 -0500 Subject: [PATCH] Remove default apache port The default apache port overlaps with horizon, but uses a different address syntax, *:80 vs 0.0.0.0:80. This causes apache2 to sometimes fail on startup with Address already in use: AH00072: make_sock: could not bind to address [::]:80 Change-Id: I7aa178878a6d283c4e5e0334a8bdcba30c8f242a --- recipes/apache2-server.rb | 5 ++++- spec/apache2-server_spec.rb | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/recipes/apache2-server.rb b/recipes/apache2-server.rb index 057f311..05ef7d1 100644 --- a/recipes/apache2-server.rb +++ b/recipes/apache2-server.rb @@ -49,8 +49,11 @@ https_bind_address = bind_address https_bind # This allows the apache2/templates/default/ports.conf.erb to setup the correct listeners. # Need to convert from Chef::Node::ImmutableArray in order to be able to modify apache2_listen = Array(node['apache']['listen']) -apache2_listen += ["#{http_bind.host}:#{http_bind.port}"] +# Remove the default apache2 cookbook port, as that is also the default for horizon, but with +# a different address syntax. *:80 vs 0.0.0.0:80 +apache2_listen -= ['*:80'] +apache2_listen += ["#{http_bind.host}:#{http_bind.port}"] if node['openstack']['dashboard']['use_ssl'] apache2_listen += ["#{https_bind.host}:#{https_bind.port}"] end diff --git a/spec/apache2-server_spec.rb b/spec/apache2-server_spec.rb index eb296a6..57f8645 100644 --- a/spec/apache2-server_spec.rb +++ b/spec/apache2-server_spec.rb @@ -54,7 +54,7 @@ describe 'openstack-dashboard::apache2-server' do end it 'set apache addresses and ports' do - expect(chef_run.node['apache']['listen']).to eq %w(*:80 0.0.0.0:80 0.0.0.0:443) + expect(chef_run.node['apache']['listen']).to eq %w(0.0.0.0:80 0.0.0.0:443) end it 'includes apache packages' do