最簡單搭建免費的https方法

現在很多網站,特別是小程序都要求https的訪問,如果你不想花幾百元買一個https的證書的話,那麼下面的方法你一定要記得收藏。

最簡單搭建免費的https方法

安裝acme.sh

curl https://get.acme.sh | sh

插入證書

acme.sh --issue -d example.com -w /home/wwwroot/example.com

nginx和apache安裝證書

apache安裝證書

acme.sh --install-cert -d example.com \\

--cert-file /path/to/certfile/in/apache/cert.pem \\

--key-file /path/to/keyfile/in/apache/key.pem \\

--fullchain-file /path/to/fullchain/certfile/apache/fullchain.pem \\

--reloadcmd "service apache2 force-reload"

nginx安裝證書

acme.sh --install-cert -d example.com \\

--key-file /path/to/keyfile/in/nginx/key.pem \\

--fullchain-file /path/to/fullchain/nginx/cert.pem \\

--reloadcmd "service nginx force-reload"

60天過期之後重新生成

acme.sh --renew -d example.com --force

最簡單搭建免費的https方法

就是這麼簡單,就是這麼方便,如果有其它的問題或者參數可以在github上面搜索acme.sh

最簡單搭建免費的https方法


分享到:


相關文章: