certbot可能是最容易出现各种问题的程序了
=========================================================================
certbot在vps上部署后,在后续renew经常遇到错误,经过检查发现是pip的问题,这其中主要包括两个问题:
一、设置源
pip设置阿里云的镜像源,速度超级快 - 修仙 - SegmentFault 思否 https://segmentfault.com/a/1190000006111096
二、设置shell语言变量
解决pip install时unsupported locale setting错误 | IT范儿 https://www.itfanr.cc/2018/09/05/pip-install-locale-error-unsupported-locale-setting/
处理掉这两个问题,基本上就能畅通无阻certbot renew了
=========================================================================
三、在执行certbot的过程中,遇到
ImportError: No module named datetime
查阅了一下,发现github上issue里面有人说
Python virtual environment sometimes can mess up when OS package updates upgrade Python. Happened to me multiple times. Last time this was because of a dist upgrade which is completely understandable. I wonder if a command line switch could be developed which would let the runner clear the `/opt/eff.org/` and retry automatically if the error output points towards a messed up virtual environment, like the `No module named datatime` nonsense. This would allow truly fire and forget operation, which is the ultimate goal, while right now I have to baby sit it still if it has any problems.
于是就很简单,把/opt/eff.org/删掉,重新执行就好了