I followed these two instructions:
Remember to config “sites-available” seperately, try not to config the global config file, for two reasons:
- It’ll be easier to maintain.
- Certbot is not that clever, so we want to leave the global config file to Certbot.
Follow the official instructions to install Certbot correctly.Then we need to choose a command to call a plugin to get CA.After I finished reading, I found out many unofficial instructions online are outdated.If we install Certbot correctly, we only need to use command:
Then Certbot can do all for you. Even can create a cron job to renew certificate automatically.