Get your own Letsencrypt SSL certificates for your site(s)

Here is where you can post tips and tricks to share with other users of MX. Do not ask for help in this Forum.
Message
Author
alamahant
Posts: 42
Joined: Thu Dec 19, 2019 9:48 pm

Get your own Letsencrypt SSL certificates for your site(s)

#1 Post by alamahant »

Letsencrypt https://letsencrypt.org/ is a fantastic organization that issues SSL certificates for free to anyone who possesses a legitimate domain or more.

Everyone can use their certificate issuance and renewal tool called "certbot" to get some certs.
It is very easy.

This is how to do it in MX

First you need to have a domain registered in your name from a commercial registrar.
If not don't worry.

Head over to Dynu where you can register up to 4 free domains in your name and have them all point to your external IP.
Please see my thread viewtopic.php?f=23&t=55034 about how to use Dynu services.
Next open a terminal and install the Apache webserver and the certbot tool.

sudo apt update && sudo apt install apache2 certbot

When apt finishes its thing please open the file

/etc/apache2/sites-available/000-default.conf

and add :
ServerAlias domain1
ServerAlias domain2
ServerAlias domain3
.
.
etc
in between the "<VirtualHost>" "</VirtualHost>" tags.
thus adding all your domains for which you need to have SSL certificates issued by Letsencrypt.

Then restart the Apache server:
systemctl restart apache2
service apache2 restart.

NOW IMPORTANT open your routers home page by navigating to 192.168.1.1 or ..2.1 or consult your routers manual.
Then enable Port-Forwarding the port 80/http FROM your WAN to the IP of your machine in your LAN.
NOTE if your are using a firewall you might need to also open port 80/http here.
After done please open a terminal and issue the following command

certbot certonly --webroot -w /var/www/html -d domain1 -d domain2 -d domain3 ######etcINCLUDE ALL YOUR DOMAINS.


Cerbot will run and issue your SSL certs effortlessly.It will only ask for your email.
The certificates will be saved to the
/etc/letsencrypt/live/<domain-name> folder.

After successfully concluding you may now TURN OFF PORT-FORWARDING in your router.


Congrats!!!
You may now create your personal blog or site over SSL.

;) ;) ;)

Return to “Tips & Tricks by users”