How To Change OpenStack’s Dashboard Root URL

.

Horizon is the canonical implementation of OpenStack’s Dashboard which provides web interface to OpenStack services like Nova, Swift, …. To access Horizon, you browse to “http://Your-IP-Address/dashboard/” and you get this page:

But what if you have multiple applications and you want to have the URL like this “http://Your-IP-Address/Something/dashboard“.  Follow these steps:

Usually the Apache main configuration file is “/etc/httpd/conf/httpd.conf“. In this file you have this statement: IncludeOptional “/etc/httpd/conf.d/*.conf”. This means the configuration files in this folder “/etc/httpd/conf.d/” are included. Open the file “/etc/httpd/conf.d/15-horizon_vhost.conf” :

# vi /etc/httpd/conf.d/15-horizon_vhost.conf

Lets say you want to add /openstack to the original URL. So you want to browse the dashboard as following “http://Your-IP-Address/openstack/dashboard“. Change this line:

WSGIScriptAlias /dashboard “/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi”

To

WSGIScriptAlias /openstack/dashboard “/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi”

Now open the file “/usr/share/openstack-dashboard/openstack_dashboard/local/local_settings.py” and customize the following lines to use “/openstack/dashboard” instead of just “/dashboard”:

LOGIN_REDIRECT_URL=”Your-IP-Address/dashboard”

LOGIN_URL = ‘/dashboard/auth/login/’
LOGOUT_URL = ‘/dashboard/auth/logout/’
LOGIN_REDIRECT_URL = ‘/dashboard’

Now you need to restart Apache:

# systemctl restart httpd.service

Now browse to “http://Your-IP-Address/openstack/dashboard” and you will get this page again. Congratulation !

Click on the picture below and look at the URL. It is changed.

And this is the page you get after successful login. Click on the picture and look at the URL:

Screenshot from 2015-03-10 21:29:51You can also make it like this “http://Your-IP-Address/openstack/horizon-dashboard“. In this case the WSGIScriptAlias will be /openstack/horizon-dashboard. The same for other parameters customization.


Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s