我正在尝试在 CentOS 7 上使用 Let's Encrypt 保护 Apache,将 Let's Encrypt SSL 证书安装到我的网站。
我的网络服务器是(包括版本):Apache (cPanel)
我的托管提供商是:GoDaddy
点击此链接为此,STEP-1 和 STEP-2 成功了
据了解,我的 VPS 中没有设置防火墙
sudo yum install epel-release
sudo yum install httpd mod_ssl python-certbot-apache
sudo systemctl start httpd
systemctl status httpd
curl www.example.com ((Note: works))
sudo certbot --apache -d example.com -d www.example.com
最后一个命令会生成错误,如下所示:
sudo: certbot: command not found
我尝试通过安装 certbot
sudo yum install certbot
并安装成功
Installed:
certbot.noarch 0:0.27.1-1.el7
Dependency Installed:
audit-libs-python.x86_64 0:2.8.1-3.el7_5.1 checkpolicy.x86_64 0:2.5-6.el7 libcgroup.x86_64 0:0.41-15.el7
libsemanage-python.x86_64 0:2.5-11.el7 policycoreutils-python.x86_64 0:2.5-22.el7 pyOpenSSL.x86_64 0:0.13.1-3.el7
python-IPy.noarch 0:0.75-6.el7 python-cffi.x86_64 0:1.6.0-5.el7 python-enum34.noarch 0:1.0.4-1.el7
python-idna.noarch 0:2.4-1.el7 python-ndg_httpsclient.noarch 0:0.3.2-1.el7 python-ply.noarch 0:3.4-11.el7
python-pycparser.noarch 0:2.14-1.el7 python-requests.noarch 0:2.6.0-1.el7_1 python-requests-toolbelt.noarch 0:0.8.0-1.el7
python-six.noarch 0:1.9.0-2.el7 python-urllib3.noarch 0:1.10.2-5.el7 python-zope-component.noarch 1:4.1.0-3.el7
python-zope-event.noarch 0:4.0.3-2.el7 python-zope-interface.x86_64 0:4.0.5-4.el7 python2-acme.noarch 0:0.27.1-1.el7
python2-certbot.noarch 0:0.27.1-1.el7 python2-configargparse.noarch 0:0.11.0-1.el7 python2-cryptography.x86_64 0:1.7.2-2.el7
python2-future.noarch 0:0.16.0-6.el7 python2-josepy.noarch 0:1.1.0-1.el7 python2-mock.noarch 0:1.0.1-9.el7
python2-parsedatetime.noarch 0:2.4-5.el7 python2-pyasn1.noarch 0:0.1.9-7.el7 python2-pyrfc3339.noarch 0:1.0-2.el7
python2-requests.noarch 0:2.6.0-0.el7 python2-six.noarch 0:1.9.0-0.el7 pytz.noarch 0:2016.10-2.el7
setools-libs.x86_64 0:3.3.8-2.el7
Complete!
我再次尝试为我的域请求 SSL 证书。
sudo certbot --apache -d example.com -d www.example.com
这次它回来了
Saving debug log to /var/log/letsencrypt/letsencrypt.log
The requested apache plugin does not appear to be installed
/var/log/letsencrypt/letsencrypt.log
2018-11-02 08:15:55,542:DEBUG:certbot.main:certbot version: 0.27.1
2018-11-02 08:15:55,542:DEBUG:certbot.main:Arguments: ['--apache', '-d', 'example.com', '-d', 'www.example.com']
2018-11-02 08:15:55,543:DEBUG:certbot.main:Discovered plugins: PluginsRegistry(PluginEntryPoint#manual,PluginEntryPoint#null,PluginEntryPoint#standalone,Plugi$
2018-11-02 08:15:55,611:DEBUG:certbot.log:Root logging level set at 20
2018-11-02 08:15:55,611:INFO:certbot.log:Saving debug log to /var/log/letsencrypt/letsencrypt.log
2018-11-02 08:15:55,613:DEBUG:certbot.plugins.selection:Requested authenticator apache and installer apache
2018-11-02 08:15:55,613:DEBUG:certbot.plugins.selection:No candidate plugin
2018-11-02 08:15:55,614:DEBUG:certbot.plugins.selection:Selected authenticator None and installer None
注意:我用我的实际域名替换了 example.com
更新1
我尝试过
sudo yum install python-certbot-apache
它正在返回
--> Finished Dependency Resolution
Error: Package: python2-certbot-apache-0.27.1-1.el7.noarch (epel)
Requires: mod_ssl
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
答案1
这样做有什么问题?:
sudo yum install mod_ssl
sudo a2enmod ssl
(然后重新启动apache)