Source :
https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-enabling-https-on-wordpress
Step 4: Confirm the bncert tool is installed on your instance
Complete the following steps to ensure the Bitnami HTTPS configuration tool (bncert) is installed on your instance. It's not preinstalled on all Certified by Bitnami WordPress instances when they're created. WordPress instances that were created on Lightsail a while back will require that you manually install the bncert tool. This procedure includes the steps to install the tool if it's is not installed.
Enter the following command to run the
bncerttool.sudo /opt/bitnami/bncert-toolIf you see
command not foundin the response as shown in the following example, then thebncerttool is not installed on your instance. Continue to the next step in this procedure to install thebncerttool on your instance.Important
The
bncerttool can only be used on WordPress instances that are Certified by Bitnami. Alternately, you can use the Certbot tool to enable HTTPS on your WordPress instance. For more information, see Tutorial: Using Let’s Encrypt SSL certificates with your WordPress instance in Amazon Lightsail.
If you see
Welcome to the Bitnami HTTPS configuration toolin the response as shown in the following example, then thebncerttool is installed on your instance. Continue to the Step 5: Enable HTTPS on your WordPress instance section of this guide.
Enter the following command to download the
bncertrun file to your instance.wget -O bncert-linux-x64.run https://downloads.bitnami.com/files/bncert/latest/bncert-linux-x64.runEnter the following command to create a directory for the
bncertrun file on your instance.sudo mkdir /opt/bitnami/bncertEnter the following command to move the downloaded
bncertrun file to the new directory you created.sudo mv bncert-linux-x64.run /opt/bitnami/bncert/Enter the following command to make the
bncertrun a file that can be executed as a program.sudo chmod +x /opt/bitnami/bncert/bncert-linux-x64.runEnter the following command to create a symbolic link that runs the
bncerttool when you enter thesudo /opt/bitnami/bncert-toolcommand.sudo ln -s /opt/bitnami/bncert/bncert-linux-x64.run /opt/bitnami/bncert-toolYou are now done installing the
bncerttool on your instance. Continue to the Step 5: Enable HTTPS on your WordPress instance section of this guide.
Step 5: Enable HTTPS on your WordPress instance
Complete the following procedure to enable HTTPs on your WordPress instance after you have confirmed that the bncert tool is installed on your instance.
Enter the following command to run the
bncerttool.sudo /opt/bitnami/bncert-toolYou should see a message similar to the following example.

If the
bncerttool has been installed on your instance for a while, then you might see a message indicating that an updated version of the tool is available. Choose to download it as shown in the following example, and then enter thesudo /opt/bitnami/bncert-toolcommand to run thebncerttool again.
Enter your primary domain name and alternate domain names separated by a space as shown in the following example.
If your domain is not configured to route traffic to the public IP address of your instance, the
bncerttool will ask you to make that configuration before continuing. Your domain must be routing traffic to the public IP address of the instance from which you are using thebncerttool to enable HTTPS on the instance. This confirms that you own the domain, and serves as the validation for your certificate.
The
bncerttool will ask you how you want your website's redirection to be configured. These are the options available:Enable HTTP to HTTPS redirection - Specifies whether users who browse to the HTTP version of your website (i.e.,
http:/example.com) are automatically redirected to the HTTPS version (i.e.,https://example.com). We recommend enabling this option because it forces all visitors to use the encrypted connection. TypeYand press Enter to enable it.Enable non-www to www redirection - Specifies whether users who browse to the apex of your domain (i.e.,
https://example.com) are automatically redirected to your domain'swwwsubdomain (i.e.,https://www.example.com). We recommend enabling this option. However, you may want to disable it and enable the alternate option (enablewwwto non-wwwredirection) if you have specified the apex of your domain as your preferred website address in search engine tools like Google's webmaster tools, or if your apex points directly to your IP and yourwwwsubdomain references your apex via a CNAME record. TypeYand press Enter to enable it.Enable www to non-www redirection - Specifies whether users who browse to your domain's
wwwsubdomain (i.e.,https://www.example.com) are automatically redirected to the apex of your domain (i.e.,https://example.com). We recommend disabling this, if you enabled non-wwwredirection towww. TypeNand press Enter to disable it.
Your selections should look like the following example.

The changes that are going to be made are listed. Type
Yand press Enter to confirm and continue.
Enter your email address to associate with your Let's Encrypt certificate and press Enter.

Review the Let's Encrypt Subscriber Agreement. Type
Yand press Enter to accept the agreement and continue.
The actions are performed to enable HTTPS on your instance, including requesting the certificate and configuring the redirections you specified.

Your certificate is successfully issued and validated, and the redirections are successfully configured on your instance if you see a message similar to the following example.

The
bncerttool will perform an automatic renewal of your certificate every 80 days before it expires. Repeat the above steps if you wish to use additional domains and subdomains with your instance, and you want to enable HTTPS for those domains.You are now done enabling HTTPS on your WordPress instance. Continue to the Step 6: Test that your website is using HTTPS section of this guide.
Step 6: Test that your website is using HTTPS
No comments:
Post a Comment