Setup Digital Ocean - Part 5 Lets Encrypt
- Part 1 LAMP
- Part 2 Upgrade PHP to 7.3
- Part 3 Apache Enable Mod Rewrite
- Part 4 Virtual Hosts
- Part 5 Lets Encrypt
- Part 6 MySQL
- Part 7 Remote MySQL
- Part 8 Composer
- Part 9 Laravel
Setting up an SSL certificate enables HTTPS on the web server, which secures the traffic between the server and the clients connecting to it. Certbot is a free and automated way to set up SSL certificates on a server. It’s included as part of the LAMP One-Click to make securing the Droplet easier.
To use Certbot, you’ll need a registered domain name and two DNS records:
An A record from a domain (e.g., example.com) to the server’s IP address
An A record from a domain prefaced with www (e.g., www.example.com) to the server’s IP address
Additionally, if you’re using a virtual hosts file, you’ll need to make sure the server name directive in the VirtualHost block (e.g., ServerName example.com) is correctly set to the domain.
Once the DNS records and, optionally, the virtual hosts files are set up, you can generate the SSL certificate. Make sure to substitute the domain in the command.
certbot --apache -d test.com -d www.test.com