發表文章

目前顯示的是有「certbot」標籤的文章

如何在AWS的Amazon-Linux主機上透過certbot配置Let's Encrypt免費且自動續啟用的SSL安全憑證

圖片
https://nikhilpurwant.com/post/tech-lets-encrypt-on-ec2/ 新的一年一樣貫徹 I code, therefore I am. 每天進步1%,持續一年你能獲得37倍成長 繼續鑽研更深一層的Infra 和 SRE技能 記得在三年前因接案所以配置過certbot免費的SSL憑證筆記 是針對佈署在Nginx上的NodeJs網站應用 如何在Digital Ocean的ubuntu主機上透過certbot配置Let's Encrypt免費且自動續啟用的SSL安全憑證 https://coolmandiary.blogspot.com/2021/02/digital-oceanubuntucertbotlets.html 這次示範在AWS的EC2 (OS: Amazon-Linux)上配置是針對Apache上的asp.net core網站應用 前情提要 Step1.下載EPEL 為了安裝CertBot,我們必須在 Amazon Linux 2中啟用EPEL儲存庫。 1 sudo amazon-linux-extras install epel 安裝並啟用 EPEL 後,就能透過 yum 安裝 CertBot Step2.安裝CertBot 1 sudo yum install certbot Step3.安裝 CertBot 的 Apache 插件 1 sudo yum install python-certbot-apache Step4. 列出使用certbot指令安裝的插件,做double check 確保有顯示Apache Web Server 插件 1 sudo certbot plugins Saving debug log to /var/log/letsencrypt/letsencrypt.log - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * apache Description: Apache Web Server plugin Interfaces: IAuthenticator, IInstaller, IPlugin Entry point: apache = cert...

如何在Digital Ocean的ubuntu主機上透過certbot配置Let's Encrypt免費且自動續啟用的SSL安全憑證

圖片
  在有一篇簡單介紹了port 443的 https https://coolmandiary.blogspot.com/2021/02/https.html 和基礎密碼學概念 而一個對外網站通常也對於安全認證算是一個門面 就跟豬肉攤有無拿到標示國產標章是類似概念 約2018之後 沒有HTTPS認證的網站預設會被Chrome瀏覽器標記為不安全 這更會影響流量和讓人多願意停留在此網頁上瀏覽的時間 在此我們採用certbot這套工具 Certbot 可在託管主機上執行的指令 sudo add-apt-repository ppa:certbot/certbot sudo apt-get update sudo apt install python-certbot-nginx (舊指令) sudo apt install python3-certbot-nginx (新版本要用這只令) 最後 sudo certbot --nginx -d {domain name} -d www.{domain name} 透過指令會自動幫我們 修改nginx default file的port設定指向443 路徑:/etc/nginx/sites-enabled 將預設80改為443  當指令一下會有如下output 這裡要小心注意會有兩個問題回應 其中當問到有用戶想要透過 HTTP 80來進入網站時要做的事情 要輸入2 給他重新導向443 HTTPS前綴的網站路徑 此時將網頁重新刷新就會發現本來顯示不安全的 突然變為有憑證的鎖頭外觀 通常是3個月就到期 這裡用 sudo certbot renew --dry-run 測試印出是否會在到期時重新啟用另一個憑證 移除參數 --dry-run 就會正常執行,會覆蓋舊憑證。 完整經過certbot幫我們弄好的 nginx default file配置文件 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 6...