Browse code

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

David Lyle authored on 2015/07/28 08:14:32
Showing 4 changed files
... ...
@@ -1,5 +1,5 @@
1 1
 <VirtualHost *:80>
2
-    WSGIScriptAlias / %HORIZON_DIR%/openstack_dashboard/wsgi/django.wsgi
2
+    WSGIScriptAlias %WEBROOT% %HORIZON_DIR%/openstack_dashboard/wsgi/django.wsgi
3 3
     WSGIDaemonProcess horizon user=%USER% group=%GROUP% processes=3 threads=10 home=%HORIZON_DIR% display-name=%{GROUP}
4 4
     WSGIApplicationGroup %{GLOBAL}
5 5
 
... ...
@@ -8,7 +8,10 @@
8 8
     WSGIProcessGroup horizon
9 9
 
10 10
     DocumentRoot %HORIZON_DIR%/.blackhole/
11
-    Alias /media %HORIZON_DIR%/openstack_dashboard/static
11
+    Alias %WEBROOT%/media %HORIZON_DIR%/openstack_dashboard/static
12
+    Alias %WEBROOT%/static %HORIZON_DIR%/static
13
+
14
+    RedirectMatch "^/$" "%WEBROOT%/"
12 15
 
13 16
     <Directory />
14 17
         Options FollowSymLinks
... ...
@@ -93,6 +93,9 @@ function init_horizon {
93 93
     local local_settings=$HORIZON_DIR/openstack_dashboard/local/local_settings.py
94 94
     cp $HORIZON_SETTINGS $local_settings
95 95
 
96
+    _horizon_config_set $local_settings "" WEBROOT \"$HORIZON_APACHE_ROOT/\"
97
+    _horizon_config_set $local_settings "" CUSTOM_THEME_PATH \"themes/webroot\"
98
+
96 99
     _horizon_config_set $local_settings "" COMPRESS_OFFLINE True
97 100
     _horizon_config_set $local_settings "" OPENSTACK_KEYSTONE_DEFAULT_ROLE \"Member\"
98 101
 
... ...
@@ -122,6 +125,7 @@ function init_horizon {
122 122
         s,%HORIZON_DIR%,$HORIZON_DIR,g;
123 123
         s,%APACHE_NAME%,$APACHE_NAME,g;
124 124
         s,%DEST%,$DEST,g;
125
+        s,%WEBROOT%,$HORIZON_APACHE_ROOT,g;
125 126
     \" $FILES/apache-horizon.template >$horizon_conf"
126 127
 
127 128
     if is_ubuntu; then
... ...
@@ -1421,7 +1421,7 @@ fi
1421 1421
 # If you installed Horizon on this server you should be able
1422 1422
 # to access the site using your browser.
1423 1423
 if is_service_enabled horizon; then
1424
-    echo "Horizon is now available at http://$SERVICE_HOST/"
1424
+    echo "Horizon is now available at http://$SERVICE_HOST$HORIZON_APACHE_ROOT"
1425 1425
 fi
1426 1426
 
1427 1427
 # If Keystone is present you can point ``nova`` cli to this server
... ...
@@ -87,6 +87,9 @@ TEMPEST_SERVICES=""
87 87
 # Set the default Nova APIs to enable
88 88
 NOVA_ENABLED_APIS=ec2,osapi_compute,metadata
89 89
 
90
+# Set the root URL for Horizon
91
+HORIZON_APACHE_ROOT="/dashboard"
92
+
90 93
 # Whether to use 'dev mode' for screen windows. Dev mode works by
91 94
 # stuffing text into the screen windows so that a developer can use
92 95
 # ctrl-c, up-arrow, enter to restart the service. Starting services