首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何安装Certbot插件?

如何安装Certbot插件?
EN

DevOps用户
提问于 2018-03-28 05:11:50
回答 8查看 34.2K关注 0票数 34

我通过以下本教程安装了Certbot:

代码语言:javascript
复制
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-nginx

现在我想设置我的证书,但我需要dns-digitalocean插件:

代码语言:javascript
复制
# certbot certonly --dns-digitalocean
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Could not choose appropriate plugin: The requested dns-digitalocean plugin does not appear to be installed
The requested dns-digitalocean plugin does not appear to be installed

我尝试用pip安装它:

代码语言:javascript
复制
pip install certbot-dns-digitalocean

但显然,apt-get版本并没有“看到”它。

如何正确安装?

EN

回答 8

DevOps用户

回答已采纳

发布于 2018-09-05 02:02:58

第一轮

代码语言:javascript
复制
# type certbot
certbot is hashed (/usr/bin/certbot)

找出安装certbot的位置。或者command -v certbot,如果你愿意的话。

然后运行head /usr/bin/certbot并注意它使用的是哪个版本的Python:

代码语言:javascript
复制
#!/usr/bin/python3

在我的例子中,它使用的是Python 3。

我从pip输出中注意到,它试图安装Python2.7包:

代码语言:javascript
复制
# pip install certbot-dns-digitalocean
Requirement already satisfied: certbot-dns-digitalocean in /usr/local/lib/python2.7/dist-packages

那么,我们如何获得pip来安装Python 3软件包呢?只需复制来自这里的说明:

代码语言:javascript
复制
cd /tmp
curl -O https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py
rm get-pip.py

现在您应该有了pip3命令,所以请运行以下命令:

代码语言:javascript
复制
pip3 install certbot-dns-digitalocean

现在再试一次

代码语言:javascript
复制
# certbot plugins
Saving debug log to /var/log/letsencrypt/letsencrypt.log

-------------------------------------------------------------------------------
* dns-digitalocean
Description: Obtain certs using a DNS TXT record (if you are using DigitalOcean
for DNS).
Interfaces: IAuthenticator, IPlugin
Entry point: dns-digitalocean =
certbot_dns_digitalocean.dns_digitalocean:Authenticator
票数 15
EN

DevOps用户

发布于 2018-08-25 16:02:14

更好的方法,感谢其他人的回应帮助我做到这一点。

确定当前安装了哪些插件:

代码语言:javascript
复制
# certbot-auto plugins
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* apache
Description: Apache Web Server plugin - Beta
Interfaces: IAuthenticator, IInstaller, IPlugin
Entry point: apache = certbot_apache.entrypoint:ENTRYPOINT

* nginx
Description: Nginx Web Server plugin
Interfaces: IAuthenticator, IInstaller, IPlugin
Entry point: nginx = certbot_nginx.configurator:NginxConfigurator

* standalone
Description: Spin up a temporary webserver
Interfaces: IAuthenticator, IPlugin
Entry point: standalone = certbot.plugins.standalone:Authenticator

* webroot
Description: Place files in webroot directory
Interfaces: IAuthenticator, IPlugin
Entry point: webroot = certbot.plugins.webroot:Authenticator
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

确定您的certbot (在我的例子中是certbot-auto)安装的位置:

代码语言:javascript
复制
# find / -name certbot
/opt/eff.org/certbot
...

进入虚拟环境并安装插件

代码语言:javascript
复制
cd /opt/eff.org/certbot/venv
source bin/activate
pip install certbot-dns-google
deactivate

再次验证certbot插件

代码语言:javascript
复制
# certbot-auto plugins
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* apache
Description: Apache Web Server plugin - Beta
Interfaces: IAuthenticator, IInstaller, IPlugin
Entry point: apache = certbot_apache.entrypoint:ENTRYPOINT

* dns-google
Description: Obtain certificates using a DNS TXT record (if you are using Google
Cloud DNS for DNS).
Interfaces: IAuthenticator, IPlugin
Entry point: dns-google = certbot_dns_google.dns_google:Authenticator

* nginx
Description: Nginx Web Server plugin
Interfaces: IAuthenticator, IInstaller, IPlugin
Entry point: nginx = certbot_nginx.configurator:NginxConfigurator

* standalone
Description: Spin up a temporary webserver
Interfaces: IAuthenticator, IPlugin
Entry point: standalone = certbot.plugins.standalone:Authenticator

* webroot
Description: Place files in webroot directory
Interfaces: IAuthenticator, IPlugin
Entry point: webroot = certbot.plugins.webroot:Authenticator
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
票数 22
EN

DevOps用户

发布于 2018-07-16 19:43:41

现在(2018年7月),您应该可以使用

代码语言:javascript
复制
pip install certbot-dns-digitalocean

代码语言:javascript
复制
git clone https://github.com/certbot/certbot.git
cd certbot/certbot-dns-digitalocean/
python setup.py install

您可能需要sudo特权。

安装后,您可能无法看到插件与certbot plugins,但您应该能够certbot certonly --dns-digitalocean只是很好。

票数 8
EN
页面原文内容由DevOps提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://devops.stackexchange.com/questions/3757

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档