Questo contenuto non è disponibile nella lingua selezionata.
10.4. Configure the Dashboard
10.4.1. Configure Connections and Logging Copia collegamentoCollegamento copiato negli appunti!
/etc/openstack-dashboard/local_settings
file (sample files are available in the Configuration Reference Guide at https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux_OpenStack_Platform):
Procedure 10.2. Configuring Connections and Logging for the Dashboard
- Set the
ALLOWED_HOSTS
parameter with a comma-separated list of host/domain names that the application can serve. For example:ALLOWED_HOSTS = ['horizon.example.com', 'localhost', '192.168.20.254', ]
ALLOWED_HOSTS = ['horizon.example.com', 'localhost', '192.168.20.254', ]
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Update the
CACHES
settings with thememcached
values:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace the following values:- Replace memcacheURL with IP address of the host on which
memcached
was installed. - Replace port with the value from the
PORT
parameter in the/etc/sysconfig/memcached
file.
- Specify the host URL for the Identity service endpoint. For example:
OPENSTACK_KEYSTONE_URL="127.0.0.1"
OPENSTACK_KEYSTONE_URL="127.0.0.1"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Update the dashboard's time zone:
TIME_ZONE="UTC"
TIME_ZONE="UTC"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The time zone can also be updated using the dashboard GUI. - To ensure the configuration changes take effect, restart the Apache service:
systemctl restart httpd.service
# systemctl restart httpd.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Note
HORIZON_CONFIG
dictionary contains all the settings for the dashboard. Whether or not a service is in the dashboard depends on the Service Catalog configuration in the Identity service.
Note
django-secure
module to ensure that most of the recommended practices and modern browser protection mechanisms are enabled. For more information http://django-secure.readthedocs.org/en/latest/ (django-secure).
10.4.2. Configure the Dashboard to Use HTTPS Copia collegamentoCollegamento copiato negli appunti!
Procedure 10.3. Configuring the Dashboard to use HTTPS
- Open the
/etc/openstack-dashboard/local_settings
file in a text editor, and uncomment the following parameters:The latter two settings instruct the browser to only send dashboard cookies over HTTPS connections, ensuring that sessions will not work over HTTP.SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOCOL', 'https') CSRF_COOKIE_SECURE = True SESSION_COOKIE_SECURE = True
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOCOL', 'https') CSRF_COOKIE_SECURE = True SESSION_COOKIE_SECURE = True
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Open the
/etc/httpd/conf/httpd.conf
file in a text editor, and add the following line:NameVirtualHost *:443
NameVirtualHost *:443
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Open the
/etc/httpd/conf.d/openstack-dashboard.conf
file in a text editor.- Delete the following lines:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Add the following lines:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
In the new configuration, Apache listens on port 443 and redirects all non-secured requests to the HTTPS protocol. The<VirtualHost *:443>
section defines the required options for this protocol, including private key, public key, and certificates. - Restart the Apache service and the
memcached
service:systemctl restart httpd.service systemctl restart memcached.service
# systemctl restart httpd.service # systemctl restart memcached.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
10.4.3. Change the Default Role for the Dashboard Copia collegamentoCollegamento copiato negli appunti!
_member_
, which is created automatically by the Identity service. This is adequate for regular users. If you choose to create a different role and set the dashboard to use this role, you must create this role in the Identity service prior to using the dashboard, then configure the dashboard to use it.
keystonerc_admin
file and on which the keystone command-line utility is installed.
Procedure 10.4. Changing the Default Role for the Dashboard
- Set up the shell to access keystone as the administrative user:
source ~/keystonerc_admin
# source ~/keystonerc_admin
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create the new role:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace NEW_ROLE with a name for the role. - Open the
/etc/openstack-dashboard/local_settings
file in a text editor, and change the value of the following parameter:OPENSTACK_KEYSTONE_DEFAULT_ROLE = 'NEW_ROLE'
OPENSTACK_KEYSTONE_DEFAULT_ROLE = 'NEW_ROLE'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace NEW_ROLE with the name of the role you created in the previous step. - Restart the Apache service for the change to take effect:
systemctl restart httpd.service
# systemctl restart httpd.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
10.4.4. Configure SELinux Copia collegamentoCollegamento copiato negli appunti!
httpd
service to the Identity server. This is also recommended if SELinux is configured in 'Permissive' mode.
Procedure 10.5. Configuring SELinux to Allow Connections from the Apache Service
- Check the status of SELinux on the system:
getenforce
# getenforce
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - If the resulting value is 'Enforcing' or 'Permissive', allow connections between the
httpd
service and the Identity service:setsebool -P httpd_can_network_connect on
# setsebool -P httpd_can_network_connect on
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
10.4.5. Configure the Dashboard Firewall Copia collegamentoCollegamento copiato negli appunti!
httpd
service and the dashboard support both HTTP and HTTPS connections. All steps in this procedure must be performed on the server hosting the httpd
service, while logged in as the root
user.
Note
Procedure 10.6. Configuring the Firewall to Allow Dashboard Traffic
- Open the
/etc/sysconfig/iptables
configuration file in a text editor:- To allow incoming connections using only HTTPS, add the following firewall rule:
-A INPUT -p tcp --dport 443 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - To allow incoming connections using both HTTP and HTTPS, add the following firewall rule:
-A INPUT -p tcp -m multiport --dports 80,443 -j ACCEPT
-A INPUT -p tcp -m multiport --dports 80,443 -j ACCEPT
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- Restart the
iptables
service for the changes to take effect:systemctl restart iptables.service
# systemctl restart iptables.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Important