在 Windows 2008 系统为 phpstudy apache 不同网站配置不同SSL证书(SNI)
有云友提问,想为 phpstudy 套件里的 apache 配置SSL证书安全访问。
环境:Windows 2008 32位系统 , phpstudy 2016(apache 2.4)
过程:
1.下载,解压,初始化好 phpstudy
2.将下载好的证书放到apache目录下,如我将yun.anqun.org的SSL证书保存在apache/conf/ssl/yun里
3.通过phpstudy的管理菜单,编辑 httpd.conf 配置文件,将约在489行的,关于ssl配置的文件启用;
Include conf/extra/httpd-ssl.conf
4.编辑 httpd-ssl.conf 文件,按实际情况配置虚拟主机的ssl内容,如本例里的 yun.anqun.org 及 portal.anqun.org 的简要配置内容如下:
##
## SSL Virtual Host Context
##
<VirtualHost *:443>
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
SSLCertificateFile "D:\phpStudy\Apache\conf\ssl\yun\213949634960268.pem"
SSLCertificateKeyFile "D:\phpStudy\Apache\conf\ssl\yun\213949634960268.key"
ServerName "yun.anqun.org"
DocumentRoot "C:\www\yun.anqun.org"
</VirtualHost>
<VirtualHost *:443>
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
SSLCertificateFile "D:\phpStudy\Apache\conf\ssl\portal\213466734260268.pem"
SSLCertificateKeyFile "D:\phpStudy\Apache\conf\ssl\portal\213466734260268.key"
ServerName "portal.anqun.org"
DocumentRoot "C:\www\portal.anqun.org"
</VirtualHost>
5.保存配置文件后,重启apache,在火狐浏览器里测试访问,显示结果正常