phpstudy apache 配置 https 证书

微信小程序开发需要用到 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
本作品采用《CC 协议》,转载必须注明作者和本文链接
讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!
未填写
文章
78
粉丝
8
喜欢
43
收藏
49
排名:82
访问:10.4 万
私信
所有博文
社区赞助商