# 为运行在Nginx上的网站配置HTTPS # 申请后Certbot会自动修改Nginx配置,建议在使用该命令前备份Nginx配置文件 $ certbot --nginx # 首次访问Let’s Encrypt服务器时需要根据提示创建账户 Saving debug log to /var/log/letsencrypt/letsencrypt.log Enter email address (used for urgent renewal and security notices) (Enter 'c' to cancel): <email@sannaha.moe>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Please read the Terms of Service at https://letsencrypt.org/documents/LE-SA-v1.3-September-21-2022.pdf. You must agree in order to register with the ACME server. Do you agree? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (Y)es/(N)o: Y
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Would you be willing, once your first certificate is successfully issued, 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 our work encrypting the web, EFF news, campaigns, and ways to support digital freedom. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (Y)es/(N)o: N Account registered.
# 选择要申请证书的域名 Which names would you like to activate HTTPS for? We recommend selecting either all domains, or all domains in a VirtualHost/server block. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1: sannaha.moe 2: thinklong.me - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Select the appropriate numbers separated by commas and/or spaces, or leave input blank to select all options shown (Enter 'c' to cancel): 1,2 Requesting a certificate for sannaha.moe and thinklong.me
Successfully received certificate. Certificate is saved at: /etc/letsencrypt/live/sannaha.moe/fullchain.pem Key is saved at: /etc/letsencrypt/live/sannaha.moe/privkey.pem This certificate expires on 2023-02-15. These files will be updated when the certificate renews. Certbot has set up a scheduled task to automatically renew this certificate in the background.
Deploying certificate Successfully deployed certificate for sannaha.moe to /etc/nginx/conf.d/sannaha.conf Successfully deployed certificate for thinklong.me to /etc/nginx/conf.d/thinklong.conf Congratulations! You have successfully enabled HTTPS on https://sannaha.moe and https://thinklong.me
$ snap install certbot-dns-cloudflare error: cannot perform the following tasks: - Run hook prepare-plug-plugin of snap "certbot" (run hook "prepare-plug-plugin": ----- Only connect this interface if you trust the plugin author to have root on the system. Run `snap set certbot trust-plugin-with-root=ok` to acknowledge this and then run this command again to perform the connection. If that doesn't work, you may need to remove all certbot-dns-* plugins from the system, then try installing the certbot snap again. -----) $ snap set certbot trust-plugin-with-root=ok $ snap install certbot-dns-cloudflare certbot-dns-cloudflare 1.32.2 from Certbot Project (certbot-eff✓) installed