關於開發微信小程序後端linux使用xampp配置https

關於開發微信小程序後端linux使用xampp配置https

背景

因爲最近開發微信小程序,先後端交互須要使用https協議,故須要配置https服務linux

服務器環境

  • 服務器系統 ubuntu
  • 環境 xampp
  • SSL服務 let's encript

步驟

  • 安裝certbot-auto:
wget https://dl.eff.org/certbot-auto --no-check-certificate
chmod +x ./certbot-auto
./certbot-auto -n
  • 申請證書:
./certbot-auto certonly --webroot --webroot-path /opt/lampp/htdocs -d xxxxx.com --agree-tos --email xxxxxx@qq.com
  • 證書在/etc/letsencrypt/live/xxxxx.com目錄下,
    而後咱們須要兩個:fullchain.pemprivkey.pem
    將其移動到/opt/lampp/etc/ssl.crt/opt/lampp/etc/ssl.key中,
    並進行相應更名爲 server.keyserver.crtweb

  • 開啓xampp的ssl功能:xampp enablesslubuntu

相關文章
相關標籤/搜索