Move your wordpress from http to https for free lamp
I just migrated my blog from http to https , I’m using linode ubuntu 20.04 ,below is the steps to move wordpress to https for free (using Let’s Encrypt)
Note: Please backup your wordpress in advance
1.Ssh to your wordpress server and install snapd using command below
sudo apt update ; sudo apt install snapd
2.Install the latest core of snapd
sudo snap install core; sudo snap refresh core
3.Remove old Certbot for your OS if any
sudo apt-get remove certbot
4.Install the latest Certbot
sudo snap install --classic certbot
5.Make a link for certbot so that you can invoke it directly
ln -s /snap/bin/certbot /usr/bin/certbot
6.Run below command to get a ssl certificate from Let’s Encript and enabled it for your apache
sudo certbot --apache
7.Test if automatic ssl renewal works or not
sudo certbot renew --dry-run
8.Go to your wp-admin web portal and change your website address from http to https
9.Verify your site is with https enabled now
10.(Optional) if you are getting posts images not with ssl enabled ,consider to run below sql to enable ssl for images(replace ubuntututorials.org with your domain name )
UPDATE wp_posts SET post_content = replace(post_content, 'http://ubuntututorials.org/wp-content/uploads','https://ubuntututorials.org/wp-content/uploads')
Refference: https://letsencrypt.org/getting-started/