(SSL证书)apache添加https

注意 服务器要打开443端口

1.申请证书,这里使用的腾讯云的SSL免费证书(阿里也有免费的)

 

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的内容

键入代码

 

 
  1. SSLStrictSNIVHostCheck off

  2. SSLCipherSuite AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL

  3. SSLProtocol all -SSLv2 -SSLv3

  4. DocumentRoot "C:\project\https" #项目地址

  5. ServerName www.scenewood.top #域名

  6. ServerAlias scenewood.top #域名

  7. #项目地址

  8. Options FollowSymLinks ExecCGI

  9. AllowOverride All

  10. Order allow,deny

  11. Allow from all

  12. Require all granted

  13. SSLEngine on

  14. SSLCertificateFile "C:\phpstudy\Apache\conf\ssl\scenewood\2_scenewood.top.crt" #证书 2_域名_crt

  15. SSLCertificateKeyFile "C:\phpstudy\Apache\conf\ssl\scenewood\3_scenewood.top.key" #证书 3_域名_key

  16. SSLCertificateChainFile "C:\phpstudy\Apache\conf\ssl\scenewood\1_root_bundle.crt" #证书 1_root_bundle.crt

 

 

6.重启apache

你可能感兴趣的:(PHP)