1、PHPSTUDY 確定開啟PHP_OPENSSL
2、
在 apache/conf/httpd.conf 中下列兩行:去掉前面的“#”
LoadModule ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf
3、(綁定域名訪問)在apache/conf文件夾下創建一個名為vhosts_ssl.conf的配置文件,增加內容如下
Listen 443
SSLStrictSNIVHostCheck off
SSLCipherSuite AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL
SSLProtocol all -SSLv2 -SSLv3
<VirtualHost *:443>
DocumentRoot "C:\web\xiaochengxu"
ServerName www.gtcw.cn
ServerAlias xiaochengxu.guoranstu.cn
Errorlog "C:\phpStudy\Apache\logs\error.log"
<Directory "C:\web\xiaochengxu">
Options FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
SSLEngine on
SSLCertificateFile "C:\phpStudy\Apache\conf\ssl\stucnserver.crt"//此處的3個證書文件就用在免費證書網站申請的那些。
SSLCertificateKeyFile "C:\phpStudy\Apache\conf\ssl\stucnserver.key"
SSLCertificateChainFile "C:\phpStudy\Apache\conf\ssl\stucnca.crt"
</VirtualHost>
3、在apache/conf/httpd.conf 中的Include conf/vhosts.conf下方增加:Include conf/vhosts_ssl.conf
重啟APACHE