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

键入代码

SSLStrictSNIVHostCheck off
SSLCipherSuite AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL
SSLProtocol all -SSLv2 -SSLv3

    DocumentRoot "C:\project\https" #项目地址
    ServerName www.scenewood.top    #域名	
    ServerAlias scenewood.top       #域名
      #项目地址
      Options FollowSymLinks ExecCGI
      AllowOverride All
      Order allow,deny
      Allow from all
      Require all granted
  
SSLEngine on
SSLCertificateFile "C:\phpstudy\Apache\conf\ssl\scenewood\2_scenewood.top.crt"     #证书 2_域名_crt
SSLCertificateKeyFile "C:\phpstudy\Apache\conf\ssl\scenewood\3_scenewood.top.key"  #证书 3_域名_key
SSLCertificateChainFile "C:\phpstudy\Apache\conf\ssl\scenewood\1_root_bundle.crt"  #证书 1_root_bundle.crt


6.重启apache



你可能感兴趣的:(扩展)