【问题标题】:Unable to install LetsEncrypt SSL on CentOS 7无法在 CentOS 7 上安装 LetsEncrypt SSL
【发布时间】:2019-04-06 16:51:32
【问题描述】:

我正在尝试在 CentOS 7 上使用 Securing Apache with Let's Encrypt 将 SSL 证书安装到我的网站。

我的网络服务器是(包括版本):Apache (cPanel)

我的托管服务提供商(如果适用)是:GoDaddy

followed this link 表示,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 替换为我的实际域

非常感谢任何帮助。在此先感谢!

【问题讨论】:

    标签: ssl centos ssl-certificate lets-encrypt certbot


    【解决方案1】:

    您可以尝试使用 --standalone 选项(不需要任何额外的 Web 服务器),但您必须关闭任何使用 443 端口的 HTTP 服务器。

    systemctl stop httpd 
    /opt/letsencrypt/certbot-auto --standalone -d mydomain.com
    

    确保您的 DNS 记录指向您正在运行 certbot 命令的 Web 服务器。

    它将证书保存在 /etc/letsencrypt/archive/mydomain.com/*.pem 并更新 /etc/letsencrypt/live/mydomain.com/ 上的符号链接。

    现在,更新您的 Apache 配置并重新启动它。

    <VirtualHost>
        ...
        SSLEngine on
        SSLCertificateFile    /etc/letsencrypt/live/mydomain.com/cert.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/mydomain.com/privkey.pem
        SSLCertificateChainFile /etc/letsencrypt/live/mydomain.com/chain.pem
        ...
    </VirtualHost>
    

    我建议您检查您的 SSL 和安全设置,以改进您网站的 apache 配置。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-11-15
      • 2017-05-27
      • 2020-06-20
      • 1970-01-01
      • 1970-01-01
      • 2020-11-04
      • 1970-01-01
      相关资源
      最近更新 更多