From 27c46d645080a770d46913f068bc23662c50a659 Mon Sep 17 00:00:00 2001 From: Mark Vanderwiel Date: Fri, 8 Apr 2016 11:18:07 -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: Ib45393b0244dd4cffb440c84c614ba9a104df105 --- recipes/server-apache.rb | 4 ++++ spec/server-apache_spec.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/recipes/server-apache.rb b/recipes/server-apache.rb index cabc4c4..d701a91 100644 --- a/recipes/server-apache.rb +++ b/recipes/server-apache.rb @@ -238,6 +238,10 @@ end #### Start of Apache specific work apache_listen = Array(node['apache']['listen']) # include already defined listen attributes +# 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 +apache_listen -= ['*:80'] + apache_listen += ["#{main_bind_address}:#{main_bind_service.port}"] apache_listen += ["#{admin_bind_address}:#{admin_bind_service.port}"] diff --git a/spec/server-apache_spec.rb b/spec/server-apache_spec.rb index 245e98e..950bae3 100644 --- a/spec/server-apache_spec.rb +++ b/spec/server-apache_spec.rb @@ -363,7 +363,7 @@ describe 'openstack-identity::server-apache' do it 'set apache addresses and ports' do expect(chef_run.node['apache']['listen']).to eq( - %w(*:80 127.0.0.1:5000 127.0.0.1:35357) + %w(127.0.0.1:5000 127.0.0.1:35357) ) end