菜单 学习猿地 - LMONKEY

VIP

开通学习猿地VIP

尊享10项VIP特权 持续新增

知识通关挑战

打卡带练!告别无效练习

接私单赚外块

VIP优先接,累计金额超百万

学习猿地私房课免费学

大厂实战课仅对VIP开放

你的一对一导师

每月可免费咨询大牛30次

领取更多软件工程师实用特权

入驻
2123
0

phpstudy apache 配置 https 证书

原创
05/13 14:22
阅读数 3393

微信小程序开发需要用到 https, 刚好本地开发 需要用到, 了解到 google 的mkcert

mkcert证书的连接

window10 使用  PowerShell 安装 以管理员打开 输入如下命令

$ Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

$ choco install mkcert

$ mkcert -install
Created a new local CA at "/Users/filippo/Library/Application Support/mkcert" ?
The local CA is now installed in the system trust store! ⚡️
The local CA is now installed in the Firefox trust store (requires browser restart)! ?

$ mkcert fast.test "*.fast.test" fast.test localhost 127.0.0.1 ::1
Using the local CA at "/Users/filippo/Library/Application Support/mkcert" ✨

Created a new certificate valid for the following names ?
 - "fast.test"
 - "*.fast.test"
 - "localhost"
 - "127.0.0.1"
 - "::1"

apache httpd.conf 配置

  • 开启 Include conf/extra/httpd-ssl.conf
  • 在 httpd-ssl.conf 配置

<VirtualHost *:443>
   DocumentRoot "D:\phpStudy\PHPTutorial\WWW\fastAdmin_test\icenter\public"
    ServerName fast.test
    ServerAlias
    SSLEngine on
    SSLProtocol all -SSLv2 -SSLv3
    SSLCipherSuite AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL

    #SSLCertificateFile "C:\phpStudy\Apache\conf\ssl\www.wlphp.com\2_www.wlphp.com.crt" 
    #SSLCertificateKeyFile "C:\phpStudy\Apache\conf\ssl\www.wlphp.com\3_www.wlphp.com.key"
    #SSLCertificateChainFile "C:\phpStudy\Apache\conf\ssl\www.wlphp.com\1_root_bundle.crt" 

    SSLCertificateFile "D:/phpStudy/PHPTutorial/Apache/conf/ssl/fast.test+5.pem"
    SSLCertificateKeyFile "D:/phpStudy/PHPTutorial/Apache/conf/ssl/fast.test+5-key.pem"
    #SSLCertificateChainFile "D:/phpStudy/PHPTutorial/Apache/conf/ssl/ca-bundle.crt"
  <Directory "D:\phpStudy\PHPTutorial\WWW\fastAdmin_test\icenter\public">
      Options FollowSymLinks ExecCGI
      AllowOverride All
      Order allow,deny
      Allow from all
     Require all granted
  </Directory>                  
</VirtualHost>

上图 成功了 一图胜千言

phpstudy apache 配置 https 证书

php

发表评论

0/200
2123 点赞
0 评论
收藏
为你推荐 换一批