剛裝上一個StartSSL 的證書沒幾天,卻看到官方發出這樣的通知:html
無聊中看到了網上各類相關的扯淡:nginx
http://tieba.baidu.com/p/4801786642
http://www.techug.com/how-wosign-gave-me-an-ssl-certificate-for-githublaravel
無心中找到一個非商業、開源的替代產品 letsencrypt ,安裝方法參考以下:git
https://certbot.eff.org/github
# CentOS 6.5 + nginx 爲例 yum install epel-release wget https://dl.eff.org/certbot-auto chmod a+x certbot-auto # 安裝依賴、生成證書 ./certbot-auto certonly --webroot -w /var/www/example -d www.example.com -d example.com # 能夠指定多個子域名,但不支持通配符 # 寫入Nginx配置文件並讓配置生效 ./certbot-auto --force-renewal --nginx # 此處容易出錯,建議先手動配置好nginx裏面ssl相關字段,而後再用certbot腳本更新。在最新的certbot-auto腳本中,只須要這條命令而不須要certonly # 在 /etc/crontab 裏面添加一行,每一個星期3自動檢查更新證書 3 3 * * 3 root /srv/laravel/certbot-auto renew --quiet --nginx &
# 若是 Nginx 安裝目錄不是默認的(好比用 OneinStack 安裝的環境),須要額外指定兩個參數,例如: ./certbot-auto --force-renewal --nginx --nginx-server-root=/usr/local/nginx/conf/ --nginx-ctl=/usr/local/nginx/sbin/nginx # 參考:https://certbot.eff.org/docs/using.html#renewing-certificates