文件來源 https://github.com/Neilpang/acme.sh/wiki/How-to-issue-a-cert domain=$domain time=`date +%Y%m%d%H%M%S` # http模式 # acme.sh --issue --standalone -d $domain -d www.$domain -w /var/www/ # # DNS模 # 可簽發泛域名證書,若是腳本不支持域名服務器自動添加TXT # 須要手工添加TXT記錄,而後 --renew # # # acme.sh --issue --dns (能夠指定默認的,如dns_ali) -d *.$domain # acme.sh --issue --dns -d *.$domain --yes-I-know-dns-manual-mode-enough-go-ahead-please # acme.sh --renew --dns -d *.$domain --yes-I-know-dns-manual-mode-enough-go-ahead-please # # san證書 # # acme.sh --issue -d $domain --standalone -d www.$domain acme.sh --issue -d $domain -w /var/www -d www.$domain mv /opt/lampp/etc/ssl.key/server.key /opt/lampp/etc/ssl.key/server.key.${time} mv /opt/lampp/etc/ssl.crt/server.crt /opt/lampp/etc/ssl.crt/server.crt.${time} /usr/bin/cp -rf /root/.acme.sh/$domain/$domain.key /opt/lampp/etc/ssl.key/server.key /usr/bin/cp -rf /root/.acme.sh/$domain/fullchain.cer /opt/lampp/etc/ssl.crt/server.crt /opt/lampp/lampp stopapache /opt/lampp/lampp startapache