一、系统环境
1、系统:Ubuntu 16.04.2 LTS
2、WEB服务器:Openresty11.2.5
二、开始配置
1、获取certbot客户端
2、停止Nginx服务
3、生成证书
当前网站有多个域名时需在后面增加,例如:
./certbot-auto certonly –standalone –email `你的邮箱地址` -d `你的域名1` -d `你的域名2`
可能会出现错误1:OSError: Command /opt/eff.org/certbot/venv/bin/python2.7 – setuptools pkg_resources pip wheel failed with error code 2
解决办法:
可能会出现错误2:
解决:说明你的Nginx服务还在运行啊!赶紧的kill掉啊
成功生成证书的输出结果:
4、查看生产的证书
5、编辑Nginx配置文件和开启SSL服务
配置虚拟主机
6、重启Nginx服务
7、Let’s Encrypt 生成的免费证书为3个月时间,使用Crontab可以无限次续签证书
遇到的坑,查边所有的地方都不能够解决,最后是内存不够用的问题?
如何解决:
最后记得释放掉分配的交换分区
Ubuntu 16.04更新遇到的错误:
Reading package lists... Done Reading package lists... Done Building dependency tree Reading state information... Done augeas-lenses is already the newest version (1.4.0-0ubuntu1). ca-certificates is already the newest version (20160104ubuntu1). gcc is already the newest version (4:5.3.1-1ubuntu1). libaugeas0 is already the newest version (1.4.0-0ubuntu1). libffi-dev is already the newest version (3.2.1-4). python is already the newest version (2.7.11-1). python-dev is already the newest version (2.7.11-1). libssl-dev is already the newest version (1.0.2g-1ubuntu4.5). openssl is already the newest version (1.0.2g-1ubuntu4.5). python-virtualenv is already the newest version (15.0.1+ds-3ubuntu1). virtualenv is already the newest version (15.0.1+ds-3ubuntu1). 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded. Creating virtual environment... Traceback (most recent call last): File "/usr/lib/python3/dist-packages/virtualenv.py", line 2363, in <module> main() File "/usr/lib/python3/dist-packages/virtualenv.py", line 719, in main symlink=options.symlink) File "/usr/lib/python3/dist-packages/virtualenv.py", line 988, in create_environment download=download, File "/usr/lib/python3/dist-packages/virtualenv.py", line 918, in install_wheel call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT) File "/usr/lib/python3/dist-packages/virtualenv.py", line 812, in call_subprocess % (cmd_desc, proc.returncode)) OSError: Command /root/.local/share/letsencrypt/bin/python2.7 - setuptools pkg_resources pip wheel failed with error code 2
解决办法:sudo apt install letsencrypt
原文链接:https://www.cnblogs.com/tinywan/p/7542629.html
原创文章,作者:优速盾-小U,如若转载,请注明出处:https://www.cdnb.net/bbs/archives/18462