【问题标题】:Setup Certbot on xampp Apache Ubuntu在 xampp Apache Ubuntu 上设置 Certbot
【发布时间】:2018-11-11 17:21:47
【问题描述】:

我尝试使用:https://certbot.eff.org/lets-encrypt/ubuntuxenial-apache 文档设置 SSL 证书。

它成功了,唯一的问题是它在错误的 Apache 服务器上。我的 Ubuntu 16.04 系统上有 2 个 Apache 服务器。 1 链接到 /var/www/html 而另一个(这个是我的 XWAMPP 服务器)正在链接到 /opt/lampp/htdocs

链接到 /var/www/html 的 Apache 服务器在这个 SSL 被激活。用命令:sudo certbot --apache

我希望它在 XAMPP 的 Apache 服务器上激活。如何编辑此命令以调用其他 Apache 服务器?

【问题讨论】:

    标签: apache ubuntu xampp lets-encrypt certbot


    【解决方案1】:

    我通过以下步骤解决了这个问题: (*) 首先,您应该可以使用 certbot 命令,并且您的虚拟主机应该配置为您需要 https 的域。 f.e. mydomain.com。验证域在您的浏览器中可用。

    1. sudo yum install certbot python2-certbot-apache
    2. certbot --apache-ctl /opt/lampp/bin/apachectl

    这个,在 /etc/letsencrypt/live/mydomain.com/ 中创建证书。

    1. 另外,步骤 2 在 /opt/lampp/etc/extra/ 中创建一个新的 vhost 文件。请查阅。
    2. 然后,将此新文件添加到您的虚拟主机区域 (/opt/lampp/etc/httpd.conf)。
    3. 重新启动您的 xampp apache。

    【讨论】:

      【解决方案2】:

      它会工作,但为此你需要静态 ip 和端口转发 80 和 443 到你的系统 ip 并与域链接你可以尝试 no-ip 他们会给你免费域之后你需要访问https://www.sslforfree.com/ 在此之后按照他们说的步骤。验证后您可以下载 ssl 文件。您需要将提取文件放在 C:\xampp\apache\conf

      在此之后转到 C:\xampp\apache\conf\extra

      并编辑 httpd-vhosts.conf 和以下内容,您可以根据您的域或根目录进行更改

      <VirtualHost *:80>
          ServerAdmin webmaster@dummy-host2.example.com
          DocumentRoot "C:/xampp/htdocs/dummy-host2.example.com"
          ServerName dummy-host2.example.com
          ErrorLog "logs/dummy-host2.example.com-error.log"
          CustomLog "logs/dummy-host2.example.com-access.log" common
      </VirtualHost>
      
      <VirtualHost *:443>
          ServerAdmin webmaster@osticket.dev
          DocumentRoot "C:/xampp/htdocs/upload"
          ServerName osticketamcat.ddns.net
          ServerAlias osticketamcat.ddns.net
          SSLEngine on
          SSLCACertificateFile "C:\xampp\apache\conf\ssl\ca_bundle.crt"
          SSLCertificateFile "C:\xampp\apache\conf\ssl.crt\server.crt"
          SSLCertificateKeyFile "C:\xampp\apache\conf\ssl.key\server.key"
          ErrorLog "logs/dummy-host.example.com-error.log"
          CustomLog "logs/dummy-host.example.com-access.log" common
          <Directory "C:/xampp/htdocs/upload">
              Options Indexes FollowSymLinks MultiViews
              AllowOverride all
              Order Deny,Allow
              Allow from all
              Require all granted
      </Directory>
      

      【讨论】:

        【解决方案3】:

        我解决了这个问题。

        sudo certbot --apache-ctl /opt/lampp/bin/apachectl
        
        sudo nano /opt/lampp/etc/httpd.conf
        ------------
        # Virtual hosts
        Include etc/extra/httpd-vhosts.conf
        Include etc/extra/httpd-vhosts-le-ssl.conf #Add it here
        

        【讨论】:

          猜你喜欢
          • 2020-06-20
          • 2020-09-13
          • 2016-09-28
          • 2017-01-11
          • 2021-11-14
          • 1970-01-01
          • 2011-02-08
          • 2017-10-12
          • 2017-12-25
          相关资源
          最近更新 更多