From cbd97ca975d1889d39f2ffd34b498080ef1ca3a9 Mon Sep 17 00:00:00 2001
From: Christian Berendt <berendt@b1-systems.de>
Date: Thu, 27 Mar 2014 12:48:43 +0000
Subject: [PATCH] use disable/enable_apache_site on Ubuntu

Using the specific Apache2 tools a2ensite and a2dissite
(used in the methods disable/enable_apache_site in lib/apache)
should be the preferred way to disable the default site and
to enable the horizon site.

fixes bug #1298031

Change-Id: I2f247c0b6e605a330086a558e03e2c36666c55be
---
 lib/horizon | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/lib/horizon b/lib/horizon
index 27c2d26a01..90a2bc5cef 100644
--- a/lib/horizon
+++ b/lib/horizon
@@ -114,11 +114,9 @@ function init_horizon {
 
     local horizon_conf=/etc/$APACHE_NAME/$APACHE_CONF_DIR/horizon.conf
     if is_ubuntu; then
-        # Clean up the old config name
-        sudo rm -f /etc/apache2/sites-enabled/000-default
-        # Be a good citizen and use the distro tools here
+        disable_apache_site 000-default
         sudo touch $horizon_conf
-        sudo a2ensite horizon.conf
+        enable_apache_site horizon.conf
     elif is_fedora; then
         sudo sed '/^Listen/s/^.*$/Listen 0.0.0.0:80/' -i /etc/httpd/conf/httpd.conf
     elif is_suse; then