用旧的方法给 Laravel 项目安装 certbot https 证书报错:
sudo certbot --nginx
Failed authorization procedure. xxx.sunzhongwei.com (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://xxx.sunzhongwei.com/.well-known/acme-challenge/xxx "<!DOCTYPE html>\n<html>\n <head>\n <meta name=\"robots\" content=\"noindex,nofollow\" />\n <style>\n /* Copyr"
从报错看,应该是要建立一个临时的目录文件,来验证网站归属。
而 Laravel 的资源跟目录是 public,所以指定参数之后,证书安装成功。
sudo certbot certonly --webroot -w /home/user_name/laravel_project_name/public -d xxx.sunzhongwei.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Obtaining a new certificate
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/xxx.sunzhongwei.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/xxx.sunzhongwei.com/privkey.pem
Your cert will expire on 2019-12-06. To obtain a new or tweaked
version of this certificate in the future, simply run certbot
again. To non-interactively renew *all* of your certificates, run
"certbot renew"
再安装之前的方法将 nginx 的配置修改即可。
微信关注我哦 👍
我是来自山东烟台的一名开发者,有感兴趣的话题,或者软件开发需求,欢迎加微信 zhongwei 聊聊, 查看更多联系方式