注意 服務器要打開443端口
1.申請證書,這里推薦騰訊雲或者阿里雲的,有免費的證書,要求不高的盆友可以試一試
2.打開php.ini擴展。
extension=php_openssl.dll
3.打開httpd.conf擴展
Include conf/extra/httpd-ssl.conf
4.把下好的證書復制到
\Apache\conf\ssl
5.編輯http-ssl.conf文件(位置:Apache\conf\extra)
刪除里http-ssl.conf的內容
鍵入代碼
SSLStrictSNIVHostCheck off SSLCipherSuite AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL SSLProtocol all -SSLv2 -SSLv3 <VirtualHost *:443> DocumentRoot "D:\WWW\httpsPro" #項目地址 ServerName ssl.test.com #域名 ServerAlias test.com #域名 <Directory "D:\WWW\httpsPro"> #項目地址 Options FollowSymLinks ExecCGI AllowOverride All Order allow,deny Allow from all Require all granted </Directory> SSLEngine on SSLCertificateFile "D:\phpstudy\Apache\conf\ssl\scenewood\2_test.com.crt" #證書 2_域名_crt SSLCertificateKeyFile "D:\phpstudy\Apache\conf\ssl\scenewood\3_test.com.key" #證書 3_域名_key SSLCertificateChainFile "D:\phpstudy\Apache\conf\ssl\scenewood\1_root_bundle.crt" #證書 1_root_bundle.crt </VirtualHost>
最后一步,重啟Apache,搞定,看看你的綠標,開心不,快樂不!
