使用OpenStack私有雲平台,通過提供的相關軟件包,安裝必要組件,將私有雲平台的訪問策略從http提升至https。
controller:
安裝相關軟件包
[root@controller ~]# yum install -y mod_wsgi httpd mod_ssl
[root@controller ~]# grep -Ev '^$|^#' /etc/httpd/conf.d/ssl.conf
Listen 443 https
SSLPassPhraseDialog exec:/usr/libexec/httpd-ssl-pass-dialog
SSLSessionCache shmcb:/run/httpd/sslcache(512000)
SSLSessionCacheTimeout 300
SSLRandomSeed startup file:/dev/urandom 256
SSLRandomSeed connect builtin
SSLCryptoDevice builtin
<VirtualHost _default_:443>
ErrorLog logs/ssl_error_log
TransferLog logs/ssl_access_log
LogLevel warn
SSLEngine on
SSLProtocol all -SSLv2 -SSLv3
SSLCipherSuite HIGH:3DES:!aNULL:!MD5:!SEED:!IDEA
SSLCertificateFile /etc/pki/tls/certs/localhost.crt
SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
<Files ~ "\.(cgi|shtml|phtml|php3?)$">
SSLOptions +StdEnvVars
</Files>
<Directory "/var/www/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
BrowserMatch "MSIE [2-5]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog logs/ssl_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
以上文件不用編輯,不查看也可以
編輯如下的文件
[root@controller ~]# vi /etc/openstack-dashboard/local_settings
CSRF_COOKIE_SECURE = True 取消注釋
SESSION_COOKIE_SECURE = True 取消注釋
USE_SSL = True 添加該行
SESSION_COOKIE_HTTPONLY = True 添加該行
然后重啟HTTP服務以及memcached服務
[root@controller ~]# systemctl restart httpd
[root@controller ~]# systemctl restart memcached

