考试首页 | 考试用书 | 培训课程 | 模拟考场 | 考试论坛  
  当前位置:Linux认证 > 红帽认证 > 红帽认证辅导 > 文章内容
  

RHCE7认证学习笔记:Apache配置与管理

来源:Linux社区 [ 2016年2月4日 ] 【

三、配置HTTPS

Https -- http + ssl(or tls)

服务器端进入/etc/pki/tls/certs目录,生成测试用的证书和私钥:
[root@linuxidc certs]# make test.crt

    安装ssl模块:

yum install mod_ssl.x86_64 -y

    编辑虚拟主机配置文件   

 43
 44    #ServerAdmin webmaster@dummy-host.example.com
 45    DocumentRoot /var/www/html/sg
 46    ServerName www.sg.com
 47    ServerAlias www1.sg.com
 48    SSLEngine on
 49    SSLCertificateFile /etc/httpd/conf/sg.crt
 50    SSLCertificateKeyFile /etc/httpd/conf/sg.key
 51    # ErrorLog "/var/log/httpd/dummy-host.example.com-error_log"
 52    # CustomLog "/var/log/httpd/dummy-host.example.com-access_log" common
 53

 32
 33    #ServerAdmin webmaster@dummy-host.example.com
 34    DocumentRoot /var/www/html/sg
 35    ServerName www.sg.com
 36    ServerAlias www1.sg.com
 37    RewriteEngine on
 38    RewriteRule ^/(.*)  https://www.sg.com/$1 [L,R]
 39    # ErrorLog "/var/log/httpd/dummy-host.example.com-error_log"
 40    # CustomLog "/var/log/httpd/dummy-host.example.com-access_log" common
 41

首页 1 2 3 尾页
本文纠错】【告诉好友】【打印此文】【返回顶部
将考试网添加到收藏夹 | 每次上网自动访问考试网 | 复制本页地址,传给QQ/MSN上的好友 | 申请链接 | 意见留言 TOP
关于本站  网站声明  广告服务  联系方式  站内导航  考试论坛
Copyright © 2007-2013 中华考试网(Examw.com) All Rights Reserved