I made it HTTPS for free with Amazon Linux2 + Freenom + Let's Encrypt, so make a note in case you do not have any trouble when you do the same work later. Basically, I will mainly write the work of Let's Encrypt.
EC2#
--Open security group inbound 80,443 ports for issuing certificates.
Freenom#
--The domain name has been acquired and the A record has been created. --www.naata.com IN A IP address
Let’s Encrypt#
$ sudo amazon-linux-extras install epel
$ sudo yum install certbot python-certbot-apache
httpd.conf
ServerName:www.naata.com
$ sudo certbot certonly --webroot -w /var/www/html/ -d www.naata.com
$ sudo ls -l /etc/letsencrypt/live/www.naata.com
total 4
lrwxrwxrwx 1 root root 56 Sep 25 07:50 cert.pem -> ../../archive/www.naata.com
lrwxrwxrwx 1 root root 57 Sep 25 07:50 chain.pem -> ../../archive/www.naata.com
lrwxrwxrwx 1 root root 61 Sep 25 07:50 fullchain.pem -> ../../archive/www.naata.com
lrwxrwxrwx 1 root root 59 Sep 25 07:50 privkey.pem -> ../../archive/www.naata.com
-rw-r--r-- 1 root root 692 Sep 25 07:50 README
$ sudo systemctl restart httpd.service
$ sudo systemctl status httpd.service
ssl.conf
SSLCertificateFile /etc/letsencrypt/live//www.naata.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live//www.naata.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live//www.naata.com/chain.pem
$ curl -vv https://www.naata.com
Recommended Posts