에디터를 선택하고 열면, 아래 스크립트를 작성한다. nginx기준 일주일에 한번, 2:45 시간에 맞춰서 자동으로 스크립트가 동작할것이다.
45 2 * * 6 sudo service nginx stop && /etc/letsencrypt/certbot-auto renew && sudo service nginx start
트러블슈팅
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address. Additionally, please check that
your computer has a publicly routable IP address and that no
firewalls are preventing the server from communicating with the
client. If you're using the webroot plugin, you should also verify
that you are serving files from the webroot path you provided.
이런 에러메시지와 마주치게된다면..
certbot certonly -d 도메인 --manual --preferred-challenges dns
NOTE: The IP of this machine will be publicly logged as having requested this
certificate. If you're running certbot in manual mode on a machine that is not
your server, please ensure you're okay with that.
Are you OK with your IP being logged?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
Please deploy a DNS TXT record under the name
_acme-challenge.somedomain.com with the following value:
여기에 나오는 키를 복사해두세요!!
sadfadsf6a8s7df67a8sd6f78 <<요런거
Before continuing, verify the record is deployed.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Press Enter to Continue
DNS 서버에 TXT 레코드를 등록하는데, 호스트의 prefix로 _acme-challenge를 쓰는걸 빼먹지마세요!!