首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在XAMPP服务器中使用letsencrypt安装SSL证书

问在XAMPP服务器中使用letsencrypt安装SSL证书
EN

Stack Overflow用户
提问于 2021-08-20 08:05:10
回答 1查看 4K关注 0票数 0

我用的是命令:

代码语言:javascript
复制
sudo certbot --apache-ctl /opt/lampp/bin/apachectl

若要在XAMPP服务器中安装证书,请执行以下操作。但是,证书正在/etc/apache2位置安装。如何重新指向XAMPP服务器?日志如下:

代码语言:javascript
复制
ubuntu@ip-172-31-33-70:~$ sudo certbot --apache-ctl /opt/lampp/bin/apachectl
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
No names were found in your configuration files. Please enter in your domain
name(s) (comma and/or space separated)  (Enter 'c' to cancel): ploshop.co.in
Cert not yet due for renewal

You have an existing certificate that has exactly the same domains or certificate name you requested and isn't close to expiry.
(ref: /etc/letsencrypt/renewal/ploshop.co.in.conf)

What would you like to do?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: Attempt to reinstall this existing certificate
2: Renew & replace the cert (limit ~5 per 7 days)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
Renewing an existing certificate
Created an SSL vhost at /etc/apache2/sites-available/000-default-le-ssl.conf
Deploying Certificate to VirtualHost /etc/apache2/sites-available/000-default-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/000-default-le-ssl.conf

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
Redirecting vhost in /etc/apache2/sites-enabled/000-default.conf to ssl vhost in /etc/apache2/sites-available/000-default-le-ssl.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Your existing certificate has been successfully renewed, and the new certificate
has been installed.

The new certificate covers the following domains: https://ploshop.co.in

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=ploshop.co.in
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/ploshop.co.in/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/ploshop.co.in/privkey.pem
   Your cert will expire on 2021-11-17. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the "certonly" option. To non-interactively renew *all* of
   your certificates, run "certbot renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

ubuntu@ip-172-31-33-70:~$
EN

回答 1

Stack Overflow用户

发布于 2021-08-20 20:17:24

根据安装修改位置。我使用的是默认路径。

编辑文件

Linux:/opt/lampp/apache/conf/extra/httpd-ssl.conf

Windows:/xampp/apache/conf/extra/httpd-ssl.conf

找到定义端口443侦听器的部分:

更改本部分:

代码语言:javascript
复制
<VirtualHost *:443>
...
    SSLEngine on
    SSLCertificateFile "conf/ssl.crt/server.crt"
    SSLCertificateKeyFile "conf/ssl.key/server.key"

至:

代码语言:javascript
复制
<VirtualHost *:443>
...
    SSLEngine on
    SSLCertificateFile "/etc/letsencrypt/live/ploshop.co.in/fullchain.pem"
    SSLCertificateKeyFile "/etc/letsencrypt/live/ploshop.co.in/privkey.pem"

不要忘记重新启动apache.

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68858881

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档