(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
<VirtualHost *:443>
    DocumentRoot "C:\project\https" #项目地址
    ServerName www.scenewood.top    #域名	
    ServerAlias scenewood.top       #域名
  <Directory "C:\project\https">    #项目地址
      Options FollowSymLinks ExecCGI
      AllowOverride All
      Order allow,deny
      Allow from all
      Require all granted
  </Directory>
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
</VirtualHost>


6.重启apache



  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值