How to Install SSL on AWS Lightsail Wordpress Instance Auto Renew




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.

  1. 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 the bncert tool is not installed on your instance. Continue to the next step in this procedure to install the bncert 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.

      Message confirming the bncert tool is not installed
    • If you see Welcome to the Bitnami HTTPS configuration tool in the response as shown in the following example, then the bncert tool is installed on your instance. Continue to the Step 5: Enable HTTPS on your WordPress instance section of this guide.

      Message confirming the bncert tool is installed
  2. 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
  3. Enter the following command to create a directory for the bncert run file on your instance.

    sudo mkdir /opt/bitnami/bncert
  4. 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/
  5. 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
  6. Enter the following command to create a symbolic link that runs the bncert tool when you enter the sudo /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.

  1. Enter the following command to run the bncert tool.

    sudo /opt/bitnami/bncert-tool

    You should see a message similar to the following example.

    Running the bncert tool

    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 the sudo /opt/bitnami/bncert-tool command to run the bncert tool again.

    Message indicating a new version of the bncert tool is available
  2. 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 the bncert tool to enable HTTPS on the instance. This confirms that you own the domain, and serves as the validation for your certificate.

    Entering the primary and alternate domain names
  3. 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. Type Y 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's www subdomain (i.e., https://www.example.com). We recommend enabling this option. However, you may want to disable it and enable the alternate option (enable www 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 your www subdomain references your apex via a CNAME record. Type Y 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 to www. Type N and press Enter to disable it.

    Your selections should look like the following example.

    Website redirection options
  4. The changes that are going to be made are listed. Type Y and press Enter to confirm and continue.

    Confirming the changes
  5. Enter your email address to associate with your Let's Encrypt certificate and press Enter.

    Associating your email address with your Let's Encrypt certificate
  6. Review the Let's Encrypt Subscriber Agreement. Type Y and press Enter to accept the agreement and continue.

    Review the Let's Encrypt subscriber agreement

    The actions are performed to enable HTTPS on your instance, including requesting the certificate and configuring the redirections you specified.

    Actions being performed

    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.

    Actions successfully completed

    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

Pages