下载apache的源文件 http://archive.apache.org/dist/httpd/
解压后进入 modules/ssl 运行下面语句
/www/wdlinux/apache/bin/apxs -a -i -DHAVE_OPENSSL=1 -I/usr/include/openssl -L/usr/lib64/openssl -c *.c -lcrypto -lssl -ldl
下面的3行不一定对。一般来说编辑 conf/extra/httpd-ssl.conf 里面启用 https比较好
下面3行仅供参考:
SSLCertficateChainFile /www/wdlinux/apache/conf/1_root_bundle.crt
SSLCertificateFile /www/wdlinux/apache/conf/2_www.域名.com.crt
SSLCertificateKeyFile /www/wdlinux/apache/conf/3_www.域名.com.key
PS:
http 80 转向到 https 443
.htaccess里面
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://www.yourname.com%{REQUEST_URI} [L,R=301]
</IfModule>