letsencrypt-auto 确实不起作用

letsencrypt-auto certonly does'nt work

无论我将哪个命令与 ./letsencrypt-auto 一起使用,结果总是与 blew 相同,我是不是遗漏了什么。 这是 ./letsencrypt-auto certonly 上的输出。

[root@tipsycore letsencrypt]# ./letsencrypt-auto certonly
#Bootstrapping dependencies for RedHat-based OSes...
#yum is /usr/bin/yum
#Loaded plugins: fastestmirror, refresh-packagekit, security
#Setting up Install Process
#Loading mirror speeds from cached hostfile
# * base: mirror.zetup.net
# * epel: ftp.lysator.liu.se
# * extras: mirror.zetup.net
# * updates: mirror.zetup.net
#Package python-2.6.6-64.el6.x86_64 already installed and latest version
#Package python-devel-2.6.6-64.el6.x86_64 already installed and latest #version
#Package python-virtualenv-1.10.1-1.el6.noarch already installed and latest #version
#Nothing to do
#Loaded plugins: fastestmirror, refresh-packagekit, security
#Setting up Install Process
#Loading mirror speeds from cached hostfile
# * base: mirror.zetup.net
# * epel: ftp.lysator.liu.se
# * extras: mirror.zetup.net
# * updates: mirror.zetup.net
#Package gcc-4.4.7-16.el6.x86_64 already installed and latest version
#Package dialog-1.1-9.20080819.1.el6.x86_64 already installed and latest #version
#Package augeas-libs-1.0.0-10.el6.x86_64 already installed and latest version
#Package openssl-devel-1.0.1e-42.el6_7.2.x86_64 already installed and latest #version
#Package libffi-devel-3.0.5-3.2.el6.x86_64 already installed and latest #version
#Package redhat-rpm-config-9.0.3-44.el6.centos.noarch already installed and #latest version
#Package ca-certificates-2015.2.4-65.0.1.el6_6.noarch already installed and #latest version
#Nothing to do
#Loaded plugins: fastestmirror, refresh-packagekit, security
#Setting up Install Process
#Loading mirror speeds from cached hostfile
# * base: mirror.zetup.net
# * epel: ftp.lysator.liu.se
# * extras: mirror.zetup.net
# * updates: mirror.zetup.net
#Package 2:mod_ssl-2.2.15-47.el6.vm.x86_64 already installed and latest #version
#Nothing to do
#WARNING: Python 2.6 support is very experimental at present...
#if you would like to work on improving it, please ensure you have backups
#and then run this script again with the --debug flag!
#[root@tipsycore letsencrypt]# 

问题(有点令人困惑)由您在 letsencrypt-auto 的输出中获得的最后一条消息描述:

#WARNING: Python 2.6 support is very experimental at present...
#if you would like to work on improving it, please ensure you have backups
#and then run this script again with the --debug flag!

您使用的 LetsEncrypt 客户端 运行ning 需要 Python 2.7 或更高版本。您已安装 Python 2.6。我有一个博客 post 描述了我解决这个问题的方法:https://thelastcicada.com/solving-the-python-2-6-issue-for-letencrypt-on-centos-6。下面我将进一步详细介绍并总结我的解决方案。

我将从这个问题和你的 letsencrypt-auto 的输出假设你正在 运行ning CentOS 6 或类似的基于 RHEL6 的操作系统。这一点很重要,因为 CentOS 6 上的系统工具都是基于 Python 2.6(尤其是 yum),因此您的系统无法安全升级到 Python 2.6。 CentOS 7 没有这个问题,并且打包了更新版本的Python。

要在 CentOS 6 上解决此问题,您可以 运行 letsencrypt-auto --debug,如错误消息中所述,但这只允许您 运行 实验性 Python 2.6 代码尚未得到很好的支持。或者,您可以使用软件集在 CentOS 6 上安装 Python 2.7,在它自己的环境中,可以 运行 与 Python 2.6 并不会弄乱您系统的默认 Python 安装。

基本步骤是:

  1. yum install centos-release-SCL 安装软件集合包
  2. yum install python27 安装 Python 2.7
  3. scl enable python27 "/root/letsencrypt/letsencrypt-auto certonly --agree-tos --webroot --webroot-path /var/www/html/mywebsite.com -d mywebsite.com" 到 运行 LetsEncrypt 客户端通过软件集合使用 Python 2.7 版本。传递给 letsencrypt-auto 的标志是我在请求 SSL 证书以与 Nginx 一起安装时使用的典型标志——您的配置可能会有所不同。

希望这对您有所帮助,祝您好运!

试试这个:

让我们加密 Centos 6

# yum install centos-release-SCL
# yum install python27 python27-python-devel python27-python-setuptools python27-python-tools python27-python-virtualenv
# ln -s /opt/rh/python27/root/usr/lib64/libpython2.7.so.1.0 /usr/lib64/libpython2.7.so.1.0
# ln -s /opt/rh/python27/root/usr/lib64/libpython2.7.so.1.0 /usr/lib64/libpython2.7.so
# ll /usr/lib64/libpyt*
lrwxrwxrwx. 1 root root      19 Aug 22  2016 /usr/lib64/libpython2.6.so -> libpython2.6.so.1.0
-r-xr-xr-x. 1 root root 1669840 Aug 18  2016 /usr/lib64/libpython2.6.so.1.0
lrwxrwxrwx  1 root root      51 Mar  1 17:59 /usr/lib64/libpython2.7.so -> /opt/rh/python27/root/usr/lib64/libpython2.7.so.1.0
lrwxrwxrwx  1 root root      51 Mar  1 17:59 /usr/lib64/libpython2.7.so.1.0 -> /opt/rh/python27/root/usr/lib64/libpython2.7.so.1.0
# /opt/rh/python27/root/usr/bin/python2.7 -V
Python 2.7.8
# vim ~/.bash_profile
PATH=/opt/rh/python27/root/usr/bin/:$PATH:$HOME/bin
export PATH
# python -V
Python 2.6.6
# source  ~/.bash_profile
# python -V
Python 2.7.8
# git clone https://github.com/letsencrypt/letsencrypt
# cd /opt/letsencrypt/
# service nginx stop
# ./letsencrypt-auto certonly --standalone -d <YOUR_DOMAIN.COM>