sed -i 's@^#Include conf/extra/httpd-ssl@Include conf/extra/httpd-ssl@' /www/wdlinux/apache/conf/httpd.conf
sed -i 's@^SSLCertificateFile@#SSLCertificateFile@' /www/wdlinux/apache/conf/extra/httpd-ssl.conf
sed -i 's@^SSLCertificateKeyFile@#SSLCertificateKeyFile@' /www/wdlinux/apache/conf/extra/httpd-ssl.conf
-----------
1,强制主站所有Web使用(全局站点)
如果要强制主站使用HTTPS,我们可以这样修改httpd配置文件:
# vim /etc/httpd/conf/httpd.conf
ServerName www.example.com:80
Redirect permanent / https://www.example.com
2,强制虚拟主机(单个站点)
如果要强制单个站点在虚拟主机上使用HTTPS,对于HTTP可以按照下面进行配置:
# vim /etc/httpd/conf/httpd.conf
<VirtualHost *:80>
ServerName proxy.mimvp.com
Redirect permanent / https://proxy.mimvp.com/
</VirtualHost>
http://blog.csdn.net/ithomer/article/details/50433363
----------------------------------------
强制Apache使用HTTPS
如果你想让你的用户访问你的webapp时只使用安全的HTTPS协议,而不是没加密过的HTTP协议,可以这样配置Apache:
在<Virtualhost *:80>里面加入如下内容:
RewriteEngine On
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R,L]
然后重启Apache, done!