Creating Wild certificates - mglacayo07/serverwiki GitHub Wiki

Step 1: Stop Services:

sudo service apache2 stop
sudo service haproxy stop
sudo service rabbitmq-server stop

Step 2: Create certificates

Command:

sudo certbot certonly --manual -d *.dudewhereismy.com.mx -d dudewhereismy.com.mx --agree-tos --no-bootstrap --manual-public-ip-logging-ok --preferred-challenges dns-01 --server https://acme-v02.api.letsencrypt.org/directory

Response

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator manual, Installer None
Obtaining a new certificate
Performing the following challenges:
dns-01 challenge for sunserver.site

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please deploy a DNS TXT record under the name
_acme-challenge.sunserver.site with the following value:

0KrmdBWqdmtxl4apbVJLLrJy_eyrXA0nGVNoOF8hD08

Before continuing, verify the record is deployed.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Press Enter to Continue

Step 3 Go to Alibaba DNS and deploy the DNS record

Go To akky and deploy the TXT record
_acme-challenge.dudewhereismy.com.mx with the value rF9Pc7WVKYxyOiNndvb9weQmvShcCFGzpZf320Utg0g

Step 4: Check the TXT record is alive

nslookup -type=txt _acme-challenge.dudewhereismy.com.mx

Check Response

;; ANSWER SECTION:
_acme-challenge.sunserver.site 300 IN TXT	"rF9Pc7WVKYxyOiNndvb9weQmvShcCFGzpZf320Utg0g"

If the response is alive continue to the next step

Waiting for verification...
Cleaning up challenges

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/sunserver.site/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/sunserver.site/privkey.pem
   Your cert will expire on 2020-08-02. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot
   again. To non-interactively renew *all* of your certificates, run
   "certbot renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

Step 4

Copy the certificates update de DOMAIN variable with the live directory trailing (-0010). Depending where certo bot install the new certificates

sudo DOMAIN='dudewhereismy.mx-0001' sudo -E bash -c 'cat /etc/letsencrypt/live/$DOMAIN/fullchain.pem /etc/letsencrypt/live/$DOMAIN/privkey.pem > /etc/haproxy/certs/dudewhereismy.mx.pem'

Step 5

Update the certificates

sudo cp /home/wsgi/Python-3.5.2/lib/python3.5/site-packages/pip/_vendor/certifi/cacert.pem  /home/wsgi/certs/.
sudo cp /etc/letsencrypt/live/dudewhereismy.mx-0001/cert.pem /home/wsgi/certs/.
sudo cp /etc/letsencrypt/live/dudewhereismy.mx-0001/privkey.pem /home/wsgi/certs/.
sudo chmod -R go-rwx /etc/haproxy/certs

Step 6

Start Services

sudo service apache2 start
sudo service haproxy start
sudo service rabbitmq-server start