求救呀, Let’s Encrypt 证书续期碰到"No module named virtualenv"问题?

2017-04-08 16:29:15 +08:00
 cpublic

折腾了好久了都, 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 证书续期无法完成,求解?

581 次点击
所在节点    VPS
9 条回复
d7101120120
2017-04-08 17:35:20 +08:00
pip install virtualenv
cpublic
2017-04-08 18:40:15 +08:00
@d7101120120 哎, pip 也是提示错误!
jimmyye
2017-04-08 19:07:38 +08:00
https://github.com/Neilpang/acme.sh 吧,没有依赖,就一脚本
cpublic
2017-04-08 22:13:40 +08:00
@jimmyye 不错,这个我用了,但是还是提示有错误,比较郁闷!
cpublic
2017-04-08 22:28:28 +08:00
使用 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

```
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
SharkIng
2017-04-09 12:27:16 +08:00
pip 的安装需要 sudo ,是这个问题么?
cpublic
2017-04-09 15:25:15 +08:00
@SharkIng 不是,我感觉应该是 pip 的依赖有问题!
msg7086
2017-04-11 02:24:25 +08:00
"Error creating new authz :: Too many invalid authorizations recently."

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/353450

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX