Let's Encrypt簡(jiǎn)介
Let's Encrypt作為一個(gè)公共且免費(fèi)SSL的項(xiàng)目逐漸被廣大用戶(hù)傳播和使用,是由Mozilla仍秤、Cisco蛋褥、Akamai、IdenTrust浴捆、EFF等組織人員發(fā)起蒜田,主要的目的也是為了推進(jìn)網(wǎng)站從HTTP向HTTPS過(guò)度的進(jìn)程,目前已經(jīng)有越來(lái)越多的商家加入和贊助支持选泻。
參考資料:
Let’s Encrypt官網(wǎng)
EFF's Certbot
1.安裝certbot
yum -y install yum-utils
yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional
sudo yum install python2-certbot-apache
2.生成的證書(shū)與配置Apache
sudo certbot --apache
執(zhí)行過(guò)程:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): **輸入郵箱地址**
Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org
-------------------------------------------------------------------------------
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v01.api.letsencrypt.org/directory
-------------------------------------------------------------------------------
(A)gree/(C)ancel: **輸入A同意服務(wù)條款**
-------------------------------------------------------------------------------
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about EFF and
our work to encrypt the web, protect its users and defend digital rights.
-------------------------------------------------------------------------------
(Y)es/(N)o: **是否接收相關(guān)郵件**
Starting new HTTPS connection (1): supporters.eff.org
Which names would you like to activate HTTPS for?
-------------------------------------------------------------------------------
**這裡將列出網(wǎng)站相關(guān)網(wǎng)址**
-------------------------------------------------------------------------------
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): ** 選擇網(wǎng)站 **
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for **網(wǎng)站網(wǎng)址**
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/httpd/conf.d/httpd-vhosts-le-ssl.conf
Deploying Certificate to VirtualHost /etc/httpd/conf.d/httpd-vhosts-le-ssl.conf
Created an SSL vhost at /etc/httpd/conf.d/httpd-vhosts-le-ssl.conf
Deploying Certificate to VirtualHost /etc/httpd/conf.d/httpd-vhosts-le-ssl.conf
Deploying Certificate to VirtualHost /etc/httpd/conf.d/httpd-vhosts-le-ssl.conf
Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
-------------------------------------------------------------------------------
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
-------------------------------------------------------------------------------
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): **是否全部導(dǎo)向https**
-------------------------------------------------------------------------------
Congratulations! You have successfully enabled **網(wǎng)站網(wǎng)址**
You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=**網(wǎng)站網(wǎng)址**
-------------------------------------------------------------------------------
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/**網(wǎng)站網(wǎng)址**/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/**網(wǎng)站網(wǎng)址**/privkey.pem
Your cert will expire on 2018-09-23. To obtain a new or tweaked
version of this certificate in the future, simply run certbot again
with the "certonly" option. To non-interactively renew *all* of
your certificates, run "certbot renew"
- Your account credentials have been saved in your Certbot
configuration directory at /etc/letsencrypt. You should make a
secure backup of this folder now. This configuration directory will
also contain certificates and private keys obtained by Certbot so
making regular backups of this folder is ideal.
- If you like Certbot, please consider supporting our work by:
3.防火牆打開(kāi)https
firewall-cmd --add-service=https --permanent
systemctl restart firewalld #重啟防火牆設(shè)定
4.測(cè)試
除了自己用瀏覽器打開(kāi)https://網(wǎng)址以外冲粤,還可以用外部服務(wù)檢查,例如:SSL Labs測(cè)試
5.排程自動(dòng)更新
Let’s Encrypt有90天的有效期页眯,必須定時(shí)更新梯捕,certbot也有這功能,只要在系統(tǒng)排程裡加入下面設(shè)定:
0 0,12 * * * python -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew