更新portage之后 安装 certbot
运行的时候一直报如下的错误:
sudo certbot
错误结果:
Traceback (most recent call last):
File "/usr/lib/python-exec/python2.7/certbot", line 11, in <module>
load_entry_point('certbot==0.30.1', 'console_scripts', 'certbot')()
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 487, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2728, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2346, in load
return self.resolve()
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2352, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/python2.7/site-packages/certbot/main.py", line 10, in <module>
import josepy as jose
File "/usr/lib/python2.7/site-packages/josepy/__init__.py", line 44, in <module>
from josepy.interfaces import JSONDeSerializable
File "/usr/lib/python2.7/site-packages/josepy/interfaces.py", line 8, in <module>
from josepy import errors, util
File "/usr/lib/python2.7/site-packages/josepy/util.py", line 4, in <module>
import OpenSSL
File "/usr/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import crypto, SSL
File "/usr/lib/python2.7/site-packages/OpenSSL/crypto.py", line 16, in <module>
from OpenSSL._util import (
File "/usr/lib/python2.7/site-packages/OpenSSL/_util.py", line 6, in <module>
from cryptography.hazmat.bindings.openssl.binding import Binding
File "/usr/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 13, in <module>
from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: /usr/lib/python2.7/site-packages/cryptography/hazmat/bindings/_openssl.so: undefined symbol: X509_get_signature_nid
搜索一圈无果
试图删除 cryptography 之后重新安装还是没用。
于是想到是不是因为openssl太旧了。
更新下
sudo emerge -u dev-libs/openssl
重新安装certbot,
sudo emerge -av app-crypt/certbot app-crypt/certbot-nginx
再次运行
sudo certbot --nginx
结果如下:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
The nginx plugin is not working; there may be problems with your existing configuration.
The error was: NoInstallationError("Could not find a usable 'nginx' binary. Ensure nginx exists, the binary is executable, and your PATH is set correctly.",)
恩,虽然没成功,但是没有代码错误了
以上错误是因为 nginx 没有放到环境变量中去,我系统的真正的nginx在/opt/nginx/sbin/nginx,于是我做了个软链接。
sudo ln -s /opt/nginx/sbin/nginx /usr/local/bin/nginx
再次执行命令
sudo certbot --nginx
得到结果:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
The nginx plugin is not working; there may be problems with your existing configuration.
The error was: PluginError('Nginx build is missing SSL module (--with-http_ssl_module).',)
查看nginx版本
$ nginx -V 结果:
nginx version: nginx/1.6.3
built by gcc 4.8.4 (Gentoo 4.8.4 p1.5, pie-0.6.1)
configure arguments: --prefix=/opt/nginx --with-http_geoip_module --add-module=/usr/src/passenger-4.0.53/ext/nginx
果然是没有ssl模块!
决定rebuild下nginx with ssl
下载nginx,我之前有下载过1.6.2还保留在那,于是直接进目录重新build。运行下面命令的时候最好用root权限
./configure --prefix=/opt/nginx --with-http_ssl_module --with-http_gzip_static_module --with-http_stub_status_module --with-cc-opt=-Wno-error --with-http_geoip_module --add-module=/usr/src/passenger-4.0.53/ext/nginx
make && make install
完成, 再检查一次nginx版本,已经加上了ssl模块
$ nginx -V
结果:
nginx version: nginx/1.6.2
built by gcc 5.4.0 (Gentoo 5.4.0-r3 p1.3, pie-0.6.5)
TLS SNI support enabled
configure arguments: --prefix=/opt/nginx --with-http_ssl_module --with-http_gzip_static_module --with-http_stub_status_module --with-cc-opt=-Wno-error --with-http_geoip_module --add-module=/usr/src/passenger-4.0.53/ext/nginx
返回最初的certbot命令再来一次, 提示我去做设置了,成功在即!
$ sudo certbot --nginx
Password:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel):
跟着提示填上email,选择需要activate HTTPS 的域名。至此nginx配置成功
重启nginx出现如下错误
sudo /etc/init.d/nginx restart
Password:
* Checking nginx' configuration ... [ ok ]
* Stopping nginx ... [ ok ]
* Starting nginx ...
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] still could not bind()
* start-stop-daemon: failed to start `/opt/nginx/sbin/nginx'
* Failed to start nginx [ !! ]
* ERROR: nginx failed to start
上述错误是因为我安装shadowsocket代理的时候占用了443 端口,于是我把shadowsocket绑定的端口改成543,然后重新启动nginx。
解决办法:
sudo fuser -k 443/tcp
sudo /etc/init.d/nginx restart
更新portage之后 安装 certbot的更多相关文章
- Gentoo更新portage记录
小记一下这两天更新服务器版本遇到的各种问题. 服务器系统: Gentoo 第一天 其实本来不打算更新系统的,因为最近想试试免费的SSL证书,于是自然而然搜到了letsencrypt,跟着他们的流程需要 ...
- Ubuntu14.04更新源、安装chrome/搜狗输入法
目录: 1.更新源 2.安装chrome 3.安装搜狗输入法 1.更新源 三步: cp /etc/apt/sources.list /etc/apt/sources.list_backup ...
- ubuntu nginx 安装 certbot(letsencrypt)
https://certbot.eff.org 到上面网站按照步骤安装certbot, 安装完成后,certbot 生成证书有两种方式 第一种:standalone模式,certbot 会启动自带的n ...
- android自动更新程序,安装完以后就什么都没有了,没有出现安装成功的界面的问题
转载自: http://blog.csdn.net/lovexieyuan520/article/details/9250099 在android软件开发中,总是需要更新版本,所以当有新版本开发的时候 ...
- FreeBSD系统更新与软件安装方法
一.系统更新 freebsd-update fetch freebsd-update install 二.软件源更新(类似yum update.apt-get update) 1.取回源 portsn ...
- 双击更新所有已安装的python模块
首先声明我是一个升级控.几乎每天会查看一下手机.电脑是否有新的应用需要更新. 同样,我的python模块也是这样.百度了一下,发现目前还没有人将更新所有模块做成一件命令,但是查到了指引,主要就是两个 ...
- Debian 8添加kali更新源并安装metasploit
一.Debian 8添加kali更新源 中科大kali更新源: deb http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contr ...
- 解决python3 pip安装、更新及yaml安装
问题:python3.6版本使用pip安装第三方库时总是报错 电脑中存在多个python版本写成对应pip版本 解决:pip3 install pyOpenSSL -i http://pypi.dou ...
- 嵌入式开发板LInux更新系统、安装软件、下载资源碰到的问题
CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none 先同步系统时间 shell 输入命令 date 如果显示的时间跟你本地时间不一样,先设 ...
随机推荐
- 【Linux】Devops的一些运维工具
一.Devops简介 从手工编译.上传服务器文件.执行命令.启动停止服务器.发现BUG再重复一遍流程,软件开发的重复劳动越来越多,在Devops概念之前,全部要靠人工手动完成,也看到了很多运维人员半夜 ...
- linux命令行挂载NTFS文件系统的移动硬盘
环境 ubuntu 12.04 桌面版 由于我的ubuntu 是安装在vmware 上,如果接入移动硬盘后,它没有办法自动识别ntfs 格式的文件系统,导致mount 盘失败 从网上找到一个方法 首先 ...
- eclipse中,添加JavaSE帮助文档和源码
- zookeeper master 选举
原文地址: http://www.cnblogs.com/nevermorewang/p/5611807.html 选主原理介绍:zookeeper的节点有两种类型,持久节点跟临时节点.临时节点有个特 ...
- 在iOS11 自定义titleview问题(位置 按钮点击)
喜欢交朋友的加:微信号 dwjluck2013 1.在自定义titleview的.h文件 里重写 intrinsicContentSize 属性 @property(nonatomic, assign ...
- 转 php include
http://www.w3school.com.cn/php/php_includes.asp PHP include 实例 例子 1 假设我们有一个名为 "footer.php" ...
- Incorrect configuration: namenode address dfs.namenode.servicerpc-address or dfs.namenode.rpc-address is not configured.
在搭建Hadoop集群的时候,遇到了这样的一个报错. 就在启动HDFS调用命令: start-dfs.sh 的时候,报错: 然后输密码就一直很奇怪,反正一直运行不成功. 百度了半天,确定是core-s ...
- postman中添加cookie信息
日常测试中有部分接口请求需要有登录信息,否则调用报错,那如何在postman中添加用户的cookie呢,主要分2个步骤: 第一步: Charles抓包获取Headers信息,拷贝Headers中的Co ...
- [问题记录]Ubuntu下chmsee安装失败的解决
日期:2016年2月26日 一直在找Ubuntu下查看chm的工具但是普遍不理想,发现在deepin中的chmsee相对比较好,但是直接执行网上的sudo apt-get install chmsee ...
- CF1059B Forgery
思路: 若某个位置是‘.’,说明不能在周围的8个位置下笔.在所有可以下笔的位置填充一次,看能否“包含”需要的图案即可. 实现: #include <iostream> using name ...