Domain name Add HTTPS

Source: Internet
Author: User
Tags ssl certificate certbot letsencrypt

Generate an HTTPS certificate for free with Let's Encrypt
    1. Download Install Certbot (let ' s Encrypt)
    2. Generate certificates with Certbot
    3. Configuring an Nginx HTTPS certificate
Installing Cerbot
[Email protected] ~]# wget https://dl.eff.org/certbot-auto[[email protected] ~]# chmod a+x certbot-auto[[email Protected] ~]#./certbot-auto
Generate certificates with Certbot

Generate a certificate for a domain name

[email protected] certbot]#./certbot-auto certonly--email [email protected]--agree-tos--webroot-w/ALIDATA1/WWW/TIMECASH22/API3-D xxxx.zjm.cn/root/.local/share/letsencrypt/lib/python2.6/site-packages/cryptography/__init__.py: -: Deprecationwarning:python2.6  isNo longer supported by the Python core team, please upgrade your python. A future version of cryptography would drop support forPython2.6deprecationwarningsaving Debug Log to/var/log/letsencrypt/letsencrypt.logobtaining aNewcertificateperforming the following challenges:http- onChallenge forxxx.zjm.cnUsing the Webroot path/alidata1/www/timecash22/api3 forAll unmatched domains. Waiting forverification ... Cleaning up challengesimportant NOTES:-congratulations!Your certificate and chain has been saved at/etc/letsencrypt/live/xxx.zjm.cn/Fullchain.pem. Your cert would expire on .- the- .. To obtain aNewor tweaked version of ThisCertificateinchThe future, simply run certbot-Auto again. to non-interactively Renew *all*of your certificates, run"Certbot-auto Renew"-If You like Certbot, please consider supporting we work by:donating to ISRG/Let's Encrypt:https://letsencrypt.org/donateDonating to Eff:https://Eff.org/donate-le


-W: Specifies the root directory of the domain-D: Specify the domain name

Note: The certificate has been generated under/etc/letsencrypy/live/xxx.zjm.cn

Nginx Configuring HTTPS Certificates

server {      443  SSL;    ....     /etc/letsencrypt/live/xxx.zjm.cn/Fullchain.pem;     /etc/letsencrypt/live/xxx.zjm.cn/Privkey.pem;     /etc/nginx/ssl/Dhparam.pem;   }

ssl_certificate and ssl_certificate_key respectively correspond to FULLCHAIN.PEM,PRIVKEY.PEM

Ssl_dhparam is generated by the following command

$ sudo mkdir/etc/nginx/-out2048

Generate one certificate for multiple domain names, i.e. multiple domain names using one SSL certificate

./certbot-auto certonly--email [email protected]--agree-tos--webroot-w/var/www/laozuo-d laozuo.org-d WWW.L Aozuo.org-w/var/www/laobuluo-d laobuluo.com-d www.laobuluo.com
Automatically update HTTPS certificates

Since this free certificate is only available for 90 days, it is time to update the following certificate periodically, which is to use Certbot to automatically update the certificate at regular intervals.

Perform updates manually

./certbot-auto  Renew--dry-run

Combine crontab to automatically update certificates every once in a while

 - 2 1 ./certbot-auto  Renew  >>/var/log/le-renew.log

Domain name Add HTTPS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.