因此,我删除了证书,认为我需要这样做,因为我得到了一个新的域名。我现在遇到了当前的错误:
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",)这是我尝试运行./certbot-auto或./certbot-auto --apache时得到的结果。有没有办法解决这个问题?
如果你需要更多的信息,请告诉我。
编辑:这是运行Ubuntu 14.04.4
发布于 2017-02-28 15:05:13
在为你的域获取SSL之前,你需要在你的Apache虚拟主机中注册你的域,这个域可以是一个真实的域,你可以将DNS设置为你的服务器IP,也可以是一个在你的Ubuntu hosts文件中定义的假域。
在这两种方法中,您都需要将您的域添加到Apache虚拟主机,然后启用它以将来自sites-available的符号链接存储到Apache的sites-enabled文件夹中。
为此,首先您需要使用以下命令cd进入sites-available Apache目录,然后,如果您从该目录ll有一个名为000-default.conf的文件,这是Apache的默认设置和配置,请在该目录中创建一个副本(最好将其命名为与您的域名相同的名称) sudo cp 000-default.conf example.com.conf,(由于具有权限,因此需要sudo)。复制文件后,使用nano、vim或您喜欢的任何终端编辑器打开文件。sudo nano example.com.conf。
当文件打开时,按如下方式配置您的域(使用正确的配置设置这些行):
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]完成配置后,保存文件并退出。然后使用以下命令启用您的网站,它将使符号链接进入您的sites-enabled目录:sudo a2ensite example.com.conf。
然后你只需要重新启动你的Apache sudo systemctl restart apache2.service。然后你就可以通过url访问你的域名了,你也可以从letsencrypt那里获得SSL证书。
附言:您可以从以下两个URL了解更多关于Apache虚拟主机的信息:Apache Documents和Digitalocean Tutorials
附注:如果您删除了以前的域和SSL,请确保已将其从您的Apache配置和虚拟主机(包括sites-available、sites-enabled和与您以前的域相关的所有文件)中完全删除。
https://stackoverflow.com/questions/42501674
复制相似问题