测试环境:CentOS release 6.6 (Final)
一、Yum安装mod_ssl模块
1、检查是否安装
# yum list | grep mod_ssl
2、未安装,执行下面代码安装
# yum install mod_ssl.x86_64
二、生产证书
# cd /etc/pki/tls/certs
# make discuz.key
Enter pass phrase: //输入密码
# mv discuz.key discuz.key.raw
# openssl rsa -in discuz.key.raw -out discuz.key
# rm -f discuz.key.raw
# chmod 400 discuz.key
# make discuz.crt serial=20150316
# mv discuz.key ../private/
三、配置ssl.conf
# vim /etc/httpd/conf.d/ssl.conf
SSLCertificateFile /etc/pki/tls/certs/discuz.crt
SSLCertificateKeyFile /etc/pki/tls/private/discuz.key
四、重启httpd
# service httpd restart
五、重设https目录
# vim /etc/httpd/conf.d/ssl.conf
DocumentRoot “/var/www/https”
保存重启httpd
# curl -w “TCP handshake:%{time_connect},SSL handshake:%{time_appconnect}\n” -so /dev/null https://www.alipay.com