今天蜗牛准给自己的512M内存VPS安装宝塔建站环境,环境安装后并且绑定了域名,想开启https访问时,想给域名安装Let’s Encrypt的免费SSL证书,但是在申请过程当中,提示了下面错误。
Bootstrapping dependencies for RedHat-based OSes that will use Python3… (you can skip this with –no-bootstrap)
yum is /usr/bin/yum
To use Certbot, packages from the EPEL repository need to be installed.
Enabling the EPEL repository in 3 seconds…[0K Enabling the EPEL repository in 2 seconds…[0K Enabling the EPEL repository in 1 second…
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: linux.mirrors.es.net
* elrepo-kernel: ftp.osuosl.org
* extras: centos.mirror.ndchost.com
* updates: mirror.keystealth.org
Package epel-release-6-8.noarch already installed and latest version
Nothing to do
No supported Python package available to install. Aborting bootstrap!
yum is /usr/bin/yum
To use Certbot, packages from the EPEL repository need to be installed.
Enabling the EPEL repository in 3 seconds…[0K Enabling the EPEL repository in 2 seconds…[0K Enabling the EPEL repository in 1 second…
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: linux.mirrors.es.net
* elrepo-kernel: ftp.osuosl.org
* extras: centos.mirror.ndchost.com
* updates: mirror.keystealth.org
Package epel-release-6-8.noarch already installed and latest version
Nothing to do
No supported Python package available to install. Aborting bootstrap!
使用翻译软件翻译了下,是Python版本太低的原因,蜗牛的高品质美国CN2VPS使用的是Centos 6系统,Python版本是2.6.6。想要成功申请Let’s Encrypt免费SSL域名证书,Python版本必须高于2.7。于是尝试着使用下面命令把Python到2.7以上版本。
wget http://python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2 #下载Python-2.7.3 tar -jxvf Python-2.7.3.tar.bz2 #解压 cd Python-2.7.3 #更改工作目录 ./configure #安装 make all #安装 make install #安装 make clean #安装 make distclean #安装 /usr/local/bin/python2.7 -V #查看版本信息 mv /usr/bin/python /usr/bin/python2.6.6 #建立软连接,使系统默认的 python指向 python2.7 ln -s /usr/local/bin/python2.7 /usr/bin/python #建立软连接,使系统默认的 python指向 python2.7 python -V #检验Python 版本 vi /usr/bin/yum #将文件头部的#!/usr/bin/python 改成#!/usr/bin/python2.6.6
虽然使用上面的方法成功把Python升级成了2.7.3版本,但是宝塔面板也无法打开了。所以如果是生产环境的系统,就不要使用上面的方案解决了,以免带来不必要的损失。
经过上面的体验,我们在高品质美国CN2VPS安装宝塔面板最好选择Centos 7系统,。如果非要使用Centos 6系统,那么最好在安装建站环境前先升级Python到2.7以上版本。