我的服务器运行在LEMP Stack Ubuntu 16.04和最后一个版本的nginx上。
我已经在我的服务器上为以下域和子域安装了SSL证书:example.com、domain1.example.com和一切正常工作。
我想为domain2.example.com创建一个新的证书
为此,我尝试了以下命令:
sudo certbot --nginx -d example.com -d domain1.example.com -d domain2.example.com --expand
无法在/etc/nginx/sites启用/example.com for set(“www.example.com”*.example.com‘,’example.com‘)中找到证书或键指令。VirtualHost未被修改。
server {
# SSL configuration
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
include snippets/ssl-example.com.conf;
include snippets/ssl-params.conf;
root /var/www/laravel/public;
index index.php index.html index.htm;
server_name example.com *.example.com www.example.com ;
}我做错什么了?如何重新创建证书以添加domain2?
发布于 2017-08-13 01:34:39
对我来说,我进入了/etc/nginx/sites-enabled文件夹,手动删除了错误的sym链接虚拟主机文件,我认为我已经删除了之前。令人惊讶的是,他们还在那里。因此,请确保在该文件夹中执行sudo rm -rf [filename]。然后通过sudo nginx -s reload重新启动nginx,并再次运行certbot命令,并且应该是GTG。
发布于 2017-08-13 09:24:51
最好的方法之一是使用webroot插件(描述了https://certbot.eff.org/#centosrhel7-other)。我建议你走下一条路:
certbot certonly命令/usr/share/nginx/html (如位置指令根)。/etc/letsencrypt/live/youdomain.com/fullchain.pem中找到您的证书。)之后,可以通过运行certbot renew命令轻松地更新证书。
当我们添加位置指令时,我们为/.well-known位置选择自定义根文件夹。Certbot在.well-known目录中创建文件,外部身份验证服务器(ACME )检查该文件夹中的文件。如果您管理许多域或使用nginx作为代理(!)为/.well-known位置使用一个公共根非常有用,因为在这种情况下,您可能在机器上没有nginx的根目录(例如,在一个VPS中安装了nginx,作为在另一个VPS中安装的Apache的代理)。
祝好运。
https://serverfault.com/questions/865160
复制相似问题