此内容没有您所选择的语言版本。
10.4. Configure the Dashboard
10.4.1. Configure Connections and Logging 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Before users connect to the dashboard for the first time, the following parameters must be configured in the
/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
The
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
It is recommended that you use the
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 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Although the default installation uses a non-encrypted channel (HTTP), it is possible to enable SSL support for the dashboard.
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
When using the HTTP version of the dashboard (through the browser), the user is redirected to the HTTPS version of the page.
10.4.3. Change the Default Role for the Dashboard 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
By default, the dashboard service uses the Identity role,
_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.
Perform this procedure on the Identity service server, or on any machine onto which you have copied the
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 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
SELinux is a security feature of Red Hat Enterprise Linux that provides access control. SELinux status values are 'Enforcing', 'Permissive', and 'Disabled'. If SELinux is in 'Enforcing' mode, you must modify the SELinux policy to allow connections from the
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 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
To allow users to connect to the dashboard, you must configure the system firewall to allow connections. The
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
To protect authentication credentials and other data, it is highly recommended that you enable only HTTPS connections.
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
These rules allow communication on ports 80 and 443 from all remote hosts to the server running the dashboard service. For information regarding the creation of more restrictive firewall rules, see the Red Hat Enterprise Linux Security Guide at the following link: