摘要:使用的官方文檔,可以選擇系統(tǒng),切換對(duì)應(yīng)的使用方法,我選擇的是安裝安裝過(guò)程中,若出現(xiàn)錯(cuò)誤,可使用解決,注意后面的要替換為提示錯(cuò)誤中的申請(qǐng)證書(shū)
Certbot使用的官方文檔,可以選擇系統(tǒng),切換對(duì)應(yīng)的使用方法,我選擇的是Ubuntu16.04+Nginx
1、安裝Cerbot$ sudo apt-get update $ sudo apt-get install software-properties-common $ sudo add-apt-repository ppa:certbot/certbot $ sudo apt-get update $ sudo apt-get install python-certbot-nginx
安裝過(guò)程中,若出現(xiàn) W: GPG error: http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease: The following signatures couldn"t be verified because the public key is not available: NO_PUBKEY 4F4EA0AAE5267A6C 錯(cuò)誤,可使用 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C 解決,注意后面的key要替換為提示錯(cuò)誤中的PUBKEY2、申請(qǐng)證書(shū)
sudo certbot --nginx --nginx-server-root /etc/nginx/ -d xxx.j2do.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator nginx, Installer nginx Enter email address (used for urgent renewal and security notices) (Enter "c" to cancel): xxxxx@126.com 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 ------------------------------------------------------------------------------- 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: N Obtaining a new certificate Performing the following challenges: http-01 challenge for ddy.j2do.com nginx: [warn] conflicting server name "" on 0.0.0.0:80, ignored nginx: [warn] conflicting server name "" on [::]:80, ignored Waiting for verification... Cleaning up challenges nginx: [warn] conflicting server name "" on 0.0.0.0:80, ignored nginx: [warn] conflicting server name "" on [::]:80, ignored Deploying Certificate to VirtualHost /etc/nginx/sites-enabled/ddy nginx: [warn] conflicting server name "" on 0.0.0.0:80, ignored nginx: [warn] conflicting server name "" on [::]:80, ignored 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): 1 ------------------------------------------------------------------------------- Congratulations! You have successfully enabled https://ddy.j2do.com You should test your configuration at: https://www.ssllabs.com/ssltest/analyze.html?d=ddy.j2do.com ------------------------------------------------------------------------------- IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/xxx.j2do.com/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/xxx.j2do.com/privkey.pem Your cert will expire on 2018-09-16. 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: Donating to ISRG / Let"s Encrypt: https://letsencrypt.org/donate Donating to EFF: https://eff.org/donate-le
第一項(xiàng)必須是選擇同意(A),第二項(xiàng)無(wú)所謂,是將記得郵件地址添加到EFF郵件列表中,發(fā)送一些郵件給你,可以選擇否(N),這時(shí)候證書(shū)會(huì)自動(dòng)生成,并根據(jù)你的域名,去查找nginx配置,自動(dòng)修改nginx配置支持https,最后詢問(wèn)你,是否要將http的請(qǐng)求全部重置到https上,配置完成后告訴你一些信息,證書(shū)存放在/etc/letsencrypt位置3、重啟nignx即可
sudo service nginx restart4、Let"s Encrypt推薦使用ACME v2證書(shū),此證書(shū)支持通配符,使證書(shū)更容易管理,稍后補(bǔ)充申請(qǐng)方法 5、自動(dòng)定時(shí)申請(qǐng)更新證書(shū)
無(wú)論如何要記得更新證書(shū)這個(gè)事情還是很麻煩,那么certbot提供了一個(gè)自動(dòng)為所有證書(shū)重新申請(qǐng)的命令,而且它是智能的,只申請(qǐng)七天內(nèi)到期的證書(shū)
#設(shè)置crontab命令 0 2 * * * certbot renew
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://www.ezyhdfw.cn/yun/39990.html
摘要:甚至和百度的搜索結(jié)果也正在給予的網(wǎng)站更高的排名和優(yōu)先收錄權(quán)。由于預(yù)設(shè)的解碼器是,所以就不能識(shí)別中文。那理解了這個(gè)錯(cuò)誤原因后,我這邊首先想到的就是網(wǎng)站的配置文件中是否含有中文。打開(kāi)一看,確實(shí)存在中文注釋。 相關(guān)知識(shí) HTTP/HTTPS 是什么? 簡(jiǎn)單來(lái)說(shuō),HTTP 是一個(gè)傳輸網(wǎng)頁(yè)內(nèi)容的協(xié)議,比如我們?yōu)g覽一個(gè)網(wǎng)頁(yè),網(wǎng)頁(yè)上的文字、圖片、 CSS 、 JS 等文件都是通過(guò) HTTP 協(xié)議傳輸...
摘要:在上使用免費(fèi)的如果你使用來(lái)做負(fù)載均衡,在上可以很方便的使用。提供期限為三個(gè)月的免費(fèi)證書(shū),到期之后需要,官方還提供自動(dòng)的工具是一個(gè)自動(dòng)申請(qǐng)和續(xù)期證書(shū)的工具。在官網(wǎng)可以找到各種和服務(wù)器下的安裝方法。常見(jiàn)的和安裝起來(lái)十分方便。 在Amazon Linux 上 使用 Lets encrypt 免費(fèi)的SSL 如果你使用ELB來(lái)做負(fù)載均衡,在AWS上可以很方便的使用SSL。如果不使用ELB就需要自...
摘要:為了推廣協(xié)議,電子前哨基金會(huì)成立了,提供免費(fèi)證書(shū)。部署,包含申請(qǐng)域名部署應(yīng)用,并開(kāi)啟服務(wù)。安裝使用獲取證書(shū)對(duì)于,使用的插件獲取。 為了推廣HTTPS協(xié)議,電子前哨基金會(huì)EFF成立了 Lets Encrypt,提供免費(fèi)證書(shū)。 Lets Encrypt一個(gè)于2015年三季度推出的數(shù)字證書(shū)認(rèn)證機(jī)構(gòu),將通過(guò)旨在消除當(dāng)前手動(dòng)創(chuàng)建和安裝證書(shū)的復(fù)雜過(guò)程的自動(dòng)化流程,為安全網(wǎng)站提供免費(fèi)的SSL/TLS...
閱讀 3589·2021-11-24 11:17
閱讀 2388·2021-11-15 11:38
閱讀 3450·2021-10-14 09:42
閱讀 2999·2019-08-30 15:54
閱讀 2078·2019-08-28 18:09
閱讀 599·2019-08-26 11:48
閱讀 1684·2019-08-26 10:48
閱讀 2217·2019-08-26 10:45