OpenStack dashboard + Apache2.4.27 + HTTPS

..
声明:
本博客欢迎转发,但请保留原作者信息!
博客地址:http://blog.csdn.net/liujiong63
新浪微博:@Jeremy____Liu
内容系本人学习、研究和总结,如有雷同,实属荣幸!


环境:centos7.2.1511
新版本Apache的配置较旧版本略有不同

修改Apache配置文件

修改apache2/conf/httpd.conf文件

LoadModule ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf

Apache加载ssl模块,配置

修改apache2/conf/extra/httpd-ssl.conf文件

修改ServerName www.example.com:443
修改ServerAdmin you@example.com
SSLEngine on
SSLCertificateFile "/etc/openstack-dashboard/ssl/cert.pem"
SSLCertificateKeyFile "/etc/openstack-dashboard/ssl/key.pem"

修改dashboard的配置

修改apache2/conf/extra/openstack-dashboard.conf文件为如下内容:

# 此项为配置http跳转到https
<VirtualHost 172.16.1.102:80>
  ServerName 172.16.1.102
  ServerAlias 172.16.1.102

  RewriteEngine On
  RewriteCond %{HTTPS} !on
  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</VirtualHost>

<VirtualHost 172.16.1.102:443>
  ServerName 172.16.1.102

  <Directory /usr/share/openstack-dashboard/openstack_dashboard/wsgi>
    Options All
    AllowOverride All
    Require all granted
  </Directory>

  <Directory /usr/share/openstack-dashboard/static>
   Options FollowSymLinks
   AllowOverride All
   Require all granted
  </Directory>

  ## Logging
  ErrorLog "/usr/local/vulfix/apache2/logs/horizon_error.log"
  ServerSignature Off
  CustomLog "/usr/local/vulfix/apache2/logs/horizon_access.log" combined

  ## RedirectMatch rules
  RedirectMatch permanent  ^/$ /dashboard

  ## Server aliases
  ServerAlias 172.16.1.102
  WSGIDaemonProcess dashboard group=apache processes=1 threads=10 user=apache
  WSGIProcessGroup dashboard
  WSGIScriptAlias /dashboard "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi"
  Alias /dashboard/static /usr/share/openstack-dashboard/static

  SSLEngine on
  SSLCertificateFile /etc/openstack-dashboard/ssl/cert.pem
  SSLCertificateKeyFile /etc/openstack-dashboard/ssl/key.pem
</VirtualHost>

制作证书和密钥文件

证书的CommonName和openstack-dashboard.conf中VirtualHost配置的ServerName保持一致

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值