Last update at :2024-06-20,Edit by888u
Whether it is to obtain an SSL certificate for free or to purchase a paid SSL, it is very convenient and low-cost. If it is an overseas website such as foreign trade or a website targeting Google search engines, it is recommended that you give priority to adding an SSL certificate to the website. However, the compatibility of search engines and auxiliary services such as Chinese websites is not yet so clear. However, you must master the basic SSL certificate configuration website in advance. There are many and convenient configurations for various server environments and quick installation of various one-click packages.
In this article, Snail wants to share the CloudXNS domain name resolution API interface seen on GITHUB, which can quickly verify domain name ownership and automatically obtain Let\\'s Encrypt SSL certificate. Of course, it can also deploy automatic renewal . We know that generally when we obtain a certificate, the domain name needs to be resolved and verified or the file ownership verified, which is a little troublesome.
After seeing this verification method, Snail thought it was more convenient. If we need to configure Let\\’s Encrypt SSL certificate, we can try this method.
First, preparations
1. The domain name uses CloudXNS DNS resolution. This method is the CloudXNS resolution service used for the domain name.
2. Enable the CloudXNS API. This is available in the settings and is not enabled by default.
The API KEY and SECRET KEY are recorded here and will need to be configured later.
3. The domain name is resolved to the server.
Second, download the automatic verification script
wget https://github.com/xdtianyu/scripts/raw/master/le-dns/le-cloudxns.shwget https://github.com/xdtianyu/scripts/raw/master/le-dns/cloudxns .confchmod +x le-cloudxns.sh
Here we download the verification script and authorize it.
Third, modify the configuration file
cloudxns.conf
Modify the configuration file, here:
API_KEY=\\”YOUR_API_KEY\\”SECRET_KEY=\\”YOUR_SECRET_KEY\\”DOMAIN=\\”laozuo.org\\”CERT_DOMAINS=\\”laozuo.org www.laozuo.org\\”#ECC =TRUE
Modify 2 API parameters here, as well as the domain name where the SSL certificate is installed.
Fourth, the installation is completed quickly
./le-cloudxns.sh cloudxns.conf
Execute the command to automatically install SSL and verify the domain name.
Verification and certificate acquisition completed. The certificate file is in the \\"certs\\" folder in the current directory.
Fifth, deploy certificate
Configuring and deploying certificates is simple. We need to introduce the two files privkey.pem and cert.pem into the configuration file and restart Nginx.
Sixth, renew Let\\’s Encrypt certificate regularly
0 0 2/20 * * /etc/nginx/le-cloudxns.sh /etc/nginx/le-cloudxns.conf >> /var/log/le-cloudxns.log 2>&1
Add it to the crontab configuration file and it will be automatically updated within 30 days before expiration.
Recommended site search: free application for domain name and space, free server permanent use, dynamic IP proxy in mainland China, com domain name, US server, domain name registration information query, asp host, use IP to check address, all-purpose space trial, domain name query,
发表评论