安装 certbot 以及 certbot nginx 插件
sudo yum install certbot python2-certbot-nginx -y
执行配置,中途会询问你的邮箱,如实填写即可
sudo certbot --nginx
自动续约
sudo certbot renew --dry-run
我个人执行到第二步 报错
Traceback (most recent call last):
File "/usr/bin/certbot", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 3112, in <module>
@_call_aside
File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 3096, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 3125, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 580, in _build_master
return cls._build_from_requirements(requires)
File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 593, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 781, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'urllib3<1.24,>=1.21.1' distribution was not found and is required by requests
此时
pip uninstall urllib3
pip uninstall requests
pip uninstall chardet
pip install --upgrade --force-reinstall 'requests==2.6.0' urllib3
如果不行 报requests错的话,通过如下方式强制重新安装requests,问题得到解决:
pip install -I requests==2.9 通过高版本来解决问题