CentOS 强制apache全站使用https 加密SSL
我的是yum安装的lamp平台,
apache 我已经配置好了 https访问。
可以参照:架设CA服务器实现https通信,web服务器使用CA自签证书与https通信
http://990487026.blog.51cto.com/10133282/1686127
安装mod_ssl
# yum instyall mod_ssl openssl
修改配置文件
# vim /etc/httpd/conf/httpd.conf
#
# 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}
重启apache
#
#
# service httpd restart
Stopping httpd:
Starting httpd:
页:
[1]