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
bncert
tool.sudo /opt/bitnami/bncert-tool
If you see
command not found
in the response as shown in the following example, then thebncert
tool is not installed on your instance. Continue to the next step in this procedure to install thebncert
tool on your instance.Important
The
bncert
tool 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 tool
in the response as shown in the following example, then thebncert
tool 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
bncert
run file to your instance.wget -O bncert-linux-x64.run https://downloads.bitnami.com/files/bncert/latest/bncert-linux-x64.run
Enter the following command to create a directory for the
bncert
run file on your instance.sudo mkdir /opt/bitnami/bncert
Enter the following command to move the downloaded
bncert
run file to the new directory you created.sudo mv bncert-linux-x64.run /opt/bitnami/bncert/
Enter the following command to make the
bncert
run a file that can be executed as a program.sudo chmod +x /opt/bitnami/bncert/bncert-linux-x64.run
Enter the following command to create a symbolic link that runs the
bncert
tool when you enter thesudo /opt/bitnami/bncert-tool
command.sudo ln -s /opt/bitnami/bncert/bncert-linux-x64.run /opt/bitnami/bncert-tool
You are now done installing the
bncert
tool 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
bncert
tool.sudo /opt/bitnami/bncert-tool
You should see a message similar to the following example.
If the
bncert
tool 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-tool
command to run thebncert
tool 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
bncert
tool 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 thebncert
tool to enable HTTPS on the instance. This confirms that you own the domain, and serves as the validation for your certificate.The
bncert
tool 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. TypeY
and 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'swww
subdomain (i.e.,https://www.example.com
). We recommend enabling this option. However, you may want to disable it and enable the alternate option (enablewww
to non-www
redirection) 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 yourwww
subdomain references your apex via a CNAME record. TypeY
and press Enter to enable it.Enable www to non-www redirection - Specifies whether users who browse to your domain's
www
subdomain (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-www
redirection towww
. TypeN
and press Enter to disable it.
Your selections should look like the following example.
The changes that are going to be made are listed. Type
Y
and 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
Y
and 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
bncert
tool 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