Shell: January 2016 Archives

Vote 0 Votes

letsencrypt.shLet's Encrypt - Free SSL/TLS Certificates (2015年底上線) 的 BASH Client, 使用非常易容易

以下範例為 目錄放在 /usr/local
Document Root 在 /var/www/html

cd /usr/local
git clone
echo > domains.txt # 建立 domains.txt, 內容是你的 domain name 及 sub domain name
mkdir -p /var/www/html/.well-known/acme-challenge # challenge-response directory
修改裡面的 WELLKNOWN=/var/www/html/.well-known/acme-challenge
執行 ./ -c

letsencrypt 憑證有效期只有三個月, 到期前要再來執行 -c
可排程每月執行, 剩餘時間要少於 30 天才會 renew, 不然只會提示 Longer than 30 days. Skipping

+ ERROR: An error occurred while sending get-request to (Status 000)
需更新 OpenSSL 的 CA

若機器有防火牆, 需開放以下 IP (for ACME challenge)

Apache 設定
Unmark Include conf/extra/httpd-ssl.conf in httpd.conf
conf/extra/httpd-ssl.conf 內容
SSLCertificateFile /usr/local/
SSLCertificateKeyFile /usr/local/
SSLCertificateChainFile /usr/local/
SSLCACertificateFile /usr/local/

ref. 用 Shell Script 寫的 Let's Encrypt Client

rsync only some extension

Vote 0 Votes

e.g. Just rsync *.jpg and *.png
rsync -avz --include '*/' --include '*.jpg' --include '*.png' --exclude '*' source/ destnation/

--include '*/' match all directories (include sub-directories)

About this Archive

This page is an archive of entries in the Shell category from January 2016.

Shell: October 2014 is the previous archive.

Shell: February 2016 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Monthly Archives