-2

无论我对 ./letsencypt-auto 使用哪个命令,结果总是与自爆相同,我是否在这里遗漏了什么。这是 ./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]# 
4

2 回答 2

0

您在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 客户端需要 Python 2.7 或更高版本。你已经安装了 Python 2.6。我有一篇博客文章描述了我解决这个问题的方式: https ://thelastcicada.com/solving-the-python-2-6-issue-for-letencrypt-on-centos-6 。下面我将进一步详细介绍并总结我的解决方案。

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

要在 CentOS 6 上解决此问题,您可以运行letsencrypt-auto --debug,如错误消息中所述,但这仅允许您运行尚未得到很好支持的实验性 Python 2.6 代码。或者,您可以使用 Software Collections 在 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"通过 Software Collections 使用 Python 2.7 版本运行 LetsEncrypt 客户端。传递给letsencrypt-auto的标志是我在请求SSL证书以与Nginx一起安装时使用的典型标志-您的配置可能有所不同。

希望这会有所帮助,祝你好运!

于 2016-02-06T18:27:10.860 回答
0

试试这个:

让我们加密 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>
于 2017-09-28T12:49:08.990 回答