折腾了好久了都, Let ’ s Encrypt 证书续期总是出现这个 virtualenv
的问题,我的VPS
用的是Debian
,求大虾帮忙看看是哪里出问题了?
具体提示如下:
……
libffi-dev is already the newest version.
python is already the newest version.
python-dev is already the newest version.
python-virtualenv is already the newest version.
virtualenv is already the newest version.
libssl-dev is already the newest version.
openssl is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Creating virtual environment...
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 7, in <module>
from virtualenv import main
ImportError: No module named virtualenv
到这里就停止了,造成 Let ’ s Encrypt 证书续期无法完成,求解?
如果运行pip install virtualenv
的话,也是错误一堆:
……
File "/usr/local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 272, in run
with self._build_session(options) as session:
File "/usr/local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 72, in _build_session
insecure_hosts=options.trusted_hosts,
File "/usr/local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/download.py", line 329, in __init__
self.headers["User-Agent"] = user_agent()
File "/usr/local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/download.py", line 93, in user_agent
from pip._vendor import distro
File "/usr/local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/_vendor/distro.py", line 1050, in <module>
_distro = LinuxDistribution()
File "/usr/local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/_vendor/distro.py", line 594, in __init__
if include_lsb else {}
File "/usr/local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/_vendor/distro.py", line 933, in _get_lsb_release_info
raise subprocess.CalledProcessError(code, cmd, stdout)
……
File "/usr/local/bin/pip", line 9, in <module>
load_entry_point('pip==9.0.1', 'console_scripts', 'pip')()
File "/usr/local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/__init__.py", line 233, in main
return command.main(cmd_args)
……
if include_lsb else {}
File "/usr/local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/_vendor/distro.py", line 933, in _get_lsb_release_info
raise subprocess.CalledProcessError(code, cmd, stdout)
subprocess.CalledProcessError: Command 'lsb_release -a' returned non-zero exit status 1
这难道是python依赖库出问题了?还是pip的问题呀?
1
d7101120120 2017-04-08 17:35:20 +08:00
pip install virtualenv
|
2
cpublic OP @d7101120120 哎, pip 也是提示错误!
|
3
jimmyye 2017-04-08 19:07:38 +08:00
用 https://github.com/Neilpang/acme.sh 吧,没有依赖,就一脚本
|
5
cpublic OP 使用 acme.sh 后是这个提示!
``` Sat Apr 8 22:27:51 CST 2017] The new-authz request is ok. [Sat Apr 8 22:27:51 CST 2017] new-authz error: {"type":"urn:acme:error:rateLimited","detail":"Error creating new authz :: Too many invalid authorizations recently.","status": 429} [Sat Apr 8 22:27:51 CST 2017] Please add '--debug' or '--log' to check more details. [Sat Apr 8 22:27:51 CST 2017] See: https://github.com/Neilpang/acme.sh/wiki/How-to-debug-acme.sh ``` |
6
jimmyye 2017-04-09 00:57:53 +08:00
也许是账号原因?我的步骤里面有设置 Email ,官方的好像没有仔细讲:
Install wget -O - https://get.acme.sh | sh # relogin or source .bashrc Setup # ACCOUNT_EMAIL: vim .acme.sh/account.conf # webroot: sudo mkdir /srv/www/acme && chown jimmyye:jimmyye /srv/www/acme sudo vim /etc/nginx/acme-challenge.conf ``` location /.well-known/acme-challenge/ { root /srv/www/acme/; try_files $uri =404; access_log off; } ``` # change /etc/nginx/site-enabled/domain.com.conf ``` server { listen 80; server_name domain.com www.domain.com; include acme-challenge.conf; location / { return 301 https://domain.com$request_uri; } } ``` Issue certs acme.sh --issue --days 60 -w /srv/www/acme -d domain.com -d www.domain.com Install certs **** Permissions **** sudo chown jimmyye:www-data /etc/nginx/ssl sudo vim /etc/sudoers.d/nginx_reload ``` # Cmnd alias specification # Nginx reload Cmnd_Alias NGINX_RELOAD = /usr/sbin/service nginx reload # No-Password Commands jimmyye ALL=NOPASSWD: NGINX_RELOAD ``` acme.sh --installcert -d domain.com --fullchainpath /etc/nginx/ssl/domain.com-chained.crt --keypath /etc/nginx/ssl/domain.com.key --reloadcmd "sudo service nginx reload" 另外测试的时候使用 --staging 或 --test 使用测试服务器,以免超出次数限制: https://github.com/Neilpang/acme.sh/wiki/Options-and-Params |
7
SharkIng 2017-04-09 12:27:16 +08:00
pip 的安装需要 sudo ,是这个问题么?
|
9
msg7086 2017-04-11 02:24:25 +08:00
"Error creating new authz :: Too many invalid authorizations recently."
|