为服务器设置SSL证书,配置Https协议

注意 服务器要打开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>

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wpyyxz.html