要有阿里云服务器帐号和域名
登入控制台 选择证书服务 购买免费证书。
购买之后会发送域名授权验证邮件
收到邮件后给域名添加解析记录完成验证
验证完成之后,证书状态变为已签发。这一步不需要很长时间。如果状态不改变可以查看上一步解析是否设置正确。
之后点击下载,根据服务器选择要安装的证书
把证书放到Apache根目录
修改配置文件,httpd.conf照做就行,httpd-ssl.conf.设置完成之后重启Apache,如果Apache重启失败,把httpd.conf
文件中 Include conf/extra/httpd-ssl.conf 注释掉,重新启动Apache。能启动成功就说明httpd-ssl.conf设置不正确。
可参考如下设置:
#### SSL Virtual Host Context##SSLEngine on
SSLProtocol TLSv1 TLSv1.1 TLSv1.2
SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4
# SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
SSLCertificateFile "C:\Program Files\phpStudy\Apache\cert\public.pem"
SSLCertificateKeyFile "C:\Program Files\phpStudy\Apache\cert\214052098260625.key"
SSLCertificateChainFile "C:\Program Files\phpStudy\Apache\cert\chain.pem"
ServerName "www.chaisz.xyz"
DocumentRoot "E:\www"SSLEngine on
SSLProtocol TLSv1 TLSv1.1 TLSv1.2
SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4
#SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
SSLCertificateFile "C:\Program Files\phpStudy\Apache\cert\public.pem"
SSLCertificateKeyFile "C:\Program Files\phpStudy\Apache\cert\214052098260625.key"
SSLCertificateChainFile "C:\Program Files\phpStudy\Apache\cert\chain.pem"
ServerName "www.chaisz.xyz"
DocumentRoot "E:\www"
证书用绝对路径,
然后重启Apache成功。
参考链接 :https://bbs.aliyun.com/read/304092.html
网友评论