From 7b105c572ed51510d951304b31c043cfe4674731 Mon Sep 17 00:00:00 2001 From: David Lyle Date: Mon, 27 Jul 2015 17:14:32 -0600 Subject: [PATCH] Move horizon apache root to /dashboard With keystone's move to /identity, a conflict in for resources was created as both keystone and horizon used /identity. The keystone config took precedence and rendered API output in the horizon UI. This patch sets the root for horizon to /dashboard and serves all horizon content from there. Additionally, a RedirectMatch has been added to the apache config for horizon to redirect '/' to '/dashboard' this will allow the implementation to change without being immediately painful to users. Also made the path '/dashboard/' configurable in stackrc. Closes-Bug: #1478306 Depends-On: I9a04f936ed6d8c14775a332dc28e903992806c42 for devstack-gate changes to remove hard coded horizon url structure assumptions. Change-Id: I6fbca5cea9e44df160afbccc71bd045437657320 --- files/apache-horizon.template | 7 +++++-- lib/horizon | 4 ++++ stack.sh | 2 +- stackrc | 3 +++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/files/apache-horizon.template b/files/apache-horizon.template index 68838985ee..bfd75678e3 100644 --- a/files/apache-horizon.template +++ b/files/apache-horizon.template @@ -1,5 +1,5 @@ - WSGIScriptAlias / %HORIZON_DIR%/openstack_dashboard/wsgi/django.wsgi + WSGIScriptAlias %WEBROOT% %HORIZON_DIR%/openstack_dashboard/wsgi/django.wsgi WSGIDaemonProcess horizon user=%USER% group=%GROUP% processes=3 threads=10 home=%HORIZON_DIR% display-name=%{GROUP} WSGIApplicationGroup %{GLOBAL} @@ -8,7 +8,10 @@ WSGIProcessGroup horizon DocumentRoot %HORIZON_DIR%/.blackhole/ - Alias /media %HORIZON_DIR%/openstack_dashboard/static + Alias %WEBROOT%/media %HORIZON_DIR%/openstack_dashboard/static + Alias %WEBROOT%/static %HORIZON_DIR%/static + + RedirectMatch "^/$" "%WEBROOT%/" Options FollowSymLinks diff --git a/lib/horizon b/lib/horizon index b0f306b675..9fe0aa8b49 100644 --- a/lib/horizon +++ b/lib/horizon @@ -93,6 +93,9 @@ function init_horizon { local local_settings=$HORIZON_DIR/openstack_dashboard/local/local_settings.py cp $HORIZON_SETTINGS $local_settings + _horizon_config_set $local_settings "" WEBROOT \"$HORIZON_APACHE_ROOT/\" + _horizon_config_set $local_settings "" CUSTOM_THEME_PATH \"themes/webroot\" + _horizon_config_set $local_settings "" COMPRESS_OFFLINE True _horizon_config_set $local_settings "" OPENSTACK_KEYSTONE_DEFAULT_ROLE \"Member\" @@ -122,6 +125,7 @@ function init_horizon { s,%HORIZON_DIR%,$HORIZON_DIR,g; s,%APACHE_NAME%,$APACHE_NAME,g; s,%DEST%,$DEST,g; + s,%WEBROOT%,$HORIZON_APACHE_ROOT,g; \" $FILES/apache-horizon.template >$horizon_conf" if is_ubuntu; then diff --git a/stack.sh b/stack.sh index cc8bc8c88f..cfcf126bda 100755 --- a/stack.sh +++ b/stack.sh @@ -1421,7 +1421,7 @@ fi # If you installed Horizon on this server you should be able # to access the site using your browser. if is_service_enabled horizon; then - echo "Horizon is now available at http://$SERVICE_HOST/" + echo "Horizon is now available at http://$SERVICE_HOST$HORIZON_APACHE_ROOT" fi # If Keystone is present you can point ``nova`` cli to this server diff --git a/stackrc b/stackrc index 8beef9639f..f4245a40cf 100644 --- a/stackrc +++ b/stackrc @@ -87,6 +87,9 @@ TEMPEST_SERVICES="" # Set the default Nova APIs to enable NOVA_ENABLED_APIS=ec2,osapi_compute,metadata +# Set the root URL for Horizon +HORIZON_APACHE_ROOT="/dashboard" + # Whether to use 'dev mode' for screen windows. Dev mode works by # stuffing text into the screen windows so that a developer can use # ctrl-c, up-arrow, enter to restart the service. Starting services