安裝let's encrypt ssl證書,雖然安裝的是centos7,執行還是要用centos6的方法,這是阿里雲比較奇特的乙個地方吧……如果用centos7的方法安裝會出現各種無法解決的錯誤。
wget
chmod a+x ./certbot-auto
./certbot-auto
let's encrypt證書的有效期為三個月,所以let's encrypt證書到期時,要使用certbot更新證書,certbot推薦使用cron或者systemd timer每天執行兩次更新證書命令,當證書不到期時,不會更新證書,當證書到期後,會自動更新證書。
1)定義systemd服務certbot.service:
sudo vi /usr/lib/systemd/system/certbot.service
內容如下:
[unit]
description=lets encrypt renewal
[service]
type=oneshot
execstart=/usr/bin/certbot renew --quiet --agree-tos
execstart:要指向你系統中certbot命令,因為你可能使用其他方式安裝。
2)定義systemd timer:
sudo vi /usr/lib/systemd/system/certbot.timer
內容如下:
[unit]
description=twice daily renewal of lets encrypts certificates
[timer]
oncalendar=0/12:00:00
randomizeddelaysec=1h
persistent=true
[install]
wantedby=timers.target
3)使timer開機自動執行
sudo systemctl enable certbot.timer
4)啟動timer
sudo systemctl start certbot.timer
references:
阿里雲Centos7安裝SSL證書
提示 apache,httpd.conf配置檔案路徑 etc httpd conf httpd.conf apache,ssl.conf配置檔案路徑 etc httpd conf.d ssl.conf 1,建立cert檔案存放ssl證書 mkdir etc httpd conf.d cert 2,安...
在Apache伺服器上安裝阿里雲ssl證書
前提條件 操作步驟 解壓後的資料夾中有3個檔案 2.在apache安裝目錄中新建cert目錄,並將解壓的apache證書 證書鏈檔案和金鑰檔案拷貝到cert目錄中。如果需要安裝多個證書,需在apache目錄中新建對應數量的cert目錄,用於存放不同的證書 3.修改httpd.conf配置檔案 i 在...
centos安裝nginx並配置SSL證書
安裝nginx的命令 sudo yum install epel release sudo yum install nginx讓nginx隨系統啟動而啟動 sudo systemctl enable nginx常用命令 啟動 nginx 停止 nginx s stop 過載配置 nginx s re...