简体   繁体   English

Letsencrypt SSL证书错误

[英]Letsencrypt SSL certificate error

So I deleted the certificate thinking that I needed to do that since I got a new domain name. 因此,我删除了证书,以为自从获得新域名以来我需要这样做。 I am currently stuck with the current error: 我目前陷入当前错误:

Root@Site:~$ certbot-auto --apache -d example.io -d www.example.io
Requesting root privileges to run certbot...
/home/maiale/.local/share/letsencrypt/bin/letsencrypt --apache -d example.io -d www.maiale.io
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Error while running apache2ctl configtest.
Action 'configtest' failed.
The Apache error log may have more information.

AH00526: Syntax error on line 35 of /etc/apache2/sites-enabled/000-default-le-ssl.conf:
SSLCertificateFile: file '/etc/letsencrypt/live/maialedesigns.com/cert.pem' does not exist or is empty

The apache plugin is not working; there may be problems with your existing configuration.
The error was: MisconfigurationError("Error while running apache2ctl configtest.\nAction 'configtest' failed.\nThe Apache error log may have more information.\n\nAH00526: Syntax error on line 35 of /etc/apache2/sites-enabled/000-default-le-ssl.conf:\nSSLCertificateFile: file '/etc/letsencrypt/live/example.com/cert.pem' does not exist or is empty\n",)

This is what I get when I try to run ./certbot-auto or ./certbot-auto --apache . 这是我尝试运行./certbot-auto./certbot-auto --apache Is there any way to fix this issue? 有什么办法可以解决此问题?

If you need any more information let me know. 如果您需要更多信息,请告诉我。

Edit: This is running Ubuntu 14.04.4 编辑:这正在运行Ubuntu 14.04.4

Before getting SSL for you domain, you need to register your domain in your Apache virtual host, the domain can either be a real domain which you set the DNS to your server IP, or it can be a fake domain defined in your Ubuntu hosts file. 在为您的域获取SSL之前,您需要在Apache虚拟主机中注册您的域,该域可以是将DNS设置为服务器IP的真实域,也可以是在Ubuntu hosts文件中定义的假域。 。

In both ways you need to add your domain to Apache virtual host and then enable it to store a symbolic link from sites-available into sites-enabled folder of your Apache. 两种方式都需要将域添加到Apache虚拟主机,然后使它能够存储来自sites-available sites-enabled的符号链接到Apache sites-enabled文件夹中。

To do that, first you need to cd into the sites-available Apache directory using the following command cd /etc/apache2/sites-available/ , then if you ll from the directory there is a file called 000-default.conf which is the default setting and configuration of Apache, make a copy from it in that directory (it is good practice to name it the same as your domain name), sudo cp 000-default.conf example.com.conf , ( sudo is required because of permission). 要做到这一点,首先需要cdsites-available的Apache目录使用以下命令cd /etc/apache2/sites-available/ ,然后如果你ll从有一个名为目录000-default.conf这是Apache的默认设置和配置,请从该目录中进行复制(最好将其命名为您的域名) sudo cp 000-default.conf example.com.conf ,( sudo是必需的,因为许可)。 After the file is copied open the file using nano , vim or whatever terminal editor you are comfortable with. 复制文件后,使用nanovim或任何您喜欢的终端编辑器打开文件。 sudo nano example.com.conf . sudo nano example.com.conf

When the file is opened configure your domain as the following (set these lines with the proper configuration): 打开文件后,将您的域配置如下(将这些行设置为正确的配置):

ServerName www.example.com [You domain name]
ServerAdmin webmaster@localhost [Email of webmaster]
DocumentRoot /var/www/html [The root of you website's files which the domain will open]

After you did the configuration, save the file and exit. 完成配置后,保存文件并退出。 Then use the following command to enable your website and it will make the symbolic link into your sites-enabled directory: sudo a2ensite example.com.conf . 然后,使用以下命令启用您的网站,它将使符号链接进入sites-enabled目录: sudo a2ensite example.com.conf

Then you only need to restart you Apache sudo systemctl restart apache2.service . 然后,您只需要重新启动Apache sudo systemctl restart apache2.service Then you have your domain available and accessible through url and you also can get SSL certificate from letsencrypt . 然后,您就可以通过url使用和访问您的域,并且还可以从letsencrypt获取SSL证书。

PS: You can read more about Apache virtual hosts from these two URLs: Apache Documents and Digitalocean Tutorials PS:您可以从以下两个URL了解有关Apache虚拟主机的更多信息: Apache文档Digitalocean教程

PS: If you have your previous domain and SSL removed, make sure it has been removed completely from your Apache configuration and virtual host that includes sites-available , sites-enabled , and all the files related to your previous domain. PS:如果您已删除了先前的域和SSL,请确保已将其彻底从Apache配置和虚拟主机中删除,其中包括sites-availablesites-enabled以及与先前域相关的所有文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Telegram Bot - 带有letsencrypt证书的Webhook SSL错误 - Telegram Bot - Webhook SSL error with letsencrypt Certificate 安装 LetsEncrypt ssl 证书时出现“无法安装证书”错误 - “Unable to install the certificate” error when installing LetsEncrypt ssl certificate MongoDB 的 LetsEncrypt SSL 证书验证失败 - LetsEncrypt SSL Certificate Validation Failed with MongoDB 如何将 LetsEncrypt SSL 证书应用于 WWW 域? - How to apply LetsEncrypt SSL certificate to WWW domain? 通过Letsencrypt SSL证书的WebSocket连接失败 - WebSocket connection failure over Letsencrypt SSL certificate 使用Cloudflare SSL证书+ Nginx letsencrypt证书进行双重加密? - Double encryption with Cloudflare SSL certificate + nginx letsencrypt certificate? LetsEncrypt:LetsEncrypt的中间证书 - LetsEncrypt : Intermediate certificate for LetsEncrypt centos6/letsencrypt - wget 的证书错误,但 curl 没有 - centos6/letsencrypt - certificate error with wget, but not with curl 建议删除ubuntu 16上的SSL证书并使用Letsencrypt NGINX生成一个SSL证书 - Recommendations to remove SSL certificate and generate one with Letsencrypt NGINX on ubuntu 16 无法获得 LetsEncrypt SSL 证书以与 AWS Lightsail 一起使用 - Can't get LetsEncrypt SSL certificate to work with AWS Lightsail
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM