From 3a9de6eb6082974b298e23171073ca8450d2b7d2 Mon Sep 17 00:00:00 2001 From: Tom Hancock Date: Tue, 18 Feb 2014 17:57:13 +0000 Subject: [PATCH] Configure horizon when using /etc/apache2. The horizon image element doesn't appear to work when the http server uses the /etc/apache2 directory. Fix up one incorrect symlink, add one more, and remove default config files which might obscure horizon on port 80. Change-Id: I6427de66f73a5853a80ea75d753218172a078d9d Closes-bug: 1281703 --- .../apache2/os-refresh-config/post-configure.d/15-apache2 | 5 +++-- .../horizon/install.d/horizon-source-install/100-horizon | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/elements/apache2/os-refresh-config/post-configure.d/15-apache2 b/elements/apache2/os-refresh-config/post-configure.d/15-apache2 index d8fb68f15..1460cbf79 100755 --- a/elements/apache2/os-refresh-config/post-configure.d/15-apache2 +++ b/elements/apache2/os-refresh-config/post-configure.d/15-apache2 @@ -33,8 +33,9 @@ if [ -f /etc/debian_version ]; then fi # Pick up on any config changes other elements may have done +# if service is not running reload isnt sufficient, so restart if [ -f /etc/debian_version ]; then - service apache2 reload + service apache2 reload || service apache2 restart elif [ -f /etc/yum.conf ]; then - service httpd reload + service httpd reload || service httpd restart fi diff --git a/elements/horizon/install.d/horizon-source-install/100-horizon b/elements/horizon/install.d/horizon-source-install/100-horizon index 5f9af5a9a..cd06d9da2 100755 --- a/elements/horizon/install.d/horizon-source-install/100-horizon +++ b/elements/horizon/install.d/horizon-source-install/100-horizon @@ -5,7 +5,9 @@ install-packages libapache2-mod-wsgi if [ -d /etc/apache2 ]; then ln -s /etc/httpd/conf.d/horizon.conf /etc/apache2/sites-available/horizon.conf - ln -s /etc/httpd/sites-available/horizon.conf /etc/apache2/sites-enabled/horizon.conf + ln -s /etc/httpd/conf.d/horizon.conf /etc/apache2/sites-enabled/horizon.conf + ln -s /var/log/apache2 /var/log/httpd + rm -f /etc/apache2/sites-enabled/{000-default.conf,default.conf,default-ssl.conf} fi os-svc-install -n horizon -u horizon -r /opt/stack/horizon