首页 > Web开发 > 详细

CentOS 强制apache全站使用https 加密SSL

时间:2016-03-16 01:56:37      阅读:251      评论:0      收藏:0      [点我收藏+]





我的是yum安装的lamp平台,

apache 我已经配置好了 https访问。 


可以参照:架设CA服务器实现https通信,web服务器使用CA自签证书与https通信

http://990487026.blog.51cto.com/10133282/1686127



安装mod_ssl

[root@nb0001 html]# yum instyall mod_ssl openssl


修改配置文件

[root@nb0001 html]# vim /etc/httpd/conf/httpd.conf
<Directory "/var/www/html">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn‘t give it to you.
#
# The Options directive is both complicated and important.  Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
    Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
    AllowOverride None
#
# Controls who can get stuff from this server.
#
    Order allow,deny
    Allow from all
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</Directory>


重启apache

[root@nb0001 html]# 
[root@nb0001 html]# 
[root@nb0001 html]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                              [  OK  ]



CentOS 强制apache全站使用https 加密SSL

原文:http://990487026.blog.51cto.com/10133282/1751219

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!