letsencrypt-auto certonly无法正常工作

时间:2016-01-13 14:10:14

标签: centos lets-encrypt

无论我使用哪个命令./letsencypt-auto,结果总是和bloww一样,我在这里遗漏了什么。 这是./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]# 

2 个答案:

答案 0 :(得分: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代码。或者,您可以使用软件集合在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"通过软件集合使用Python 2.7版本运行LetsEncrypt客户端。传递给letsencrypt-auto的标志是我在请求使用Nginx安装SSL证书时使用的典型标志 - 您的配置因我而异。
  4. 希望这会有所帮助并祝你好运!

答案 1 :(得分: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>