How to generate Let's Encrypt SSL cert for Bitnami Lightsail

So you just setup a new shiny WordPress website on a Lightsail (WordPress) instance. Now, you’ve been told to setup an SSL certificate for your website domain. What to do? The following steps show how to generate a free SSL certificate provided by Let’s Encrypt. bitnami@ip-172-26-12-25:~$ sudo /opt/bitnami/bncert-tool ---------------------------------------------------------------------------- Welcome to the Bitnami HTTPS Configuration tool. ---------------------------------------------------------------------------- Domains Please provide a valid space-separated list of domains for which you wish to configure your web server. Domain list []: lightsail.example.com The following domains were not included: www.lightsail.example.com. Do you want to add them? [Y/n]: n Warning: No www domains (e.g. www.example.com) or non-www domains (e.g. www.example.com) have been provided, so the following redirections will be disabled: non-www to www, www to non-www. Press [Enter] to continue: ---------------------------------------------------------------------------- Enable/disable redirections Please select the redirections you wish to enable or disable on your Bitnami installation. Enable HTTP to HTTPS redirection [Y/n]: Y ---------------------------------------------------------------------------- Changes to perform The following changes will be performed to your Bitnami installation: 1. Stop web server 2. Configure web server to use a free Let's Encrypt certificate for the domains: lightsail.example.com 3. Configure a cron job to automatically renew the certificate each month 4. Configure web server name to: lightsail.example.com 5. Enable HTTP to HTTPS redirection (example: redirect http://lightsail.example.com to https://lightsail.example.com) 6. Start web server once all changes have been performed Do you agree to these changes? [Y/n]: Y ---------------------------------------------------------------------------- Create a free HTTPS certificate with Let's Encrypt Please provide a valid e-mail address for which to associate your Let's Encrypt certificate. Domain list: lightsail.example.com Server name: lightsail.example.com E-mail address []: validemail@example.com The Let's Encrypt Subscriber Agreement can be found at: https://letsencrypt.org/documents/LE-SA-v1.3-September-21-2022.pdf Do you agree to the Let's Encrypt Subscriber Agreement? [Y/n]: ---------------------------------------------------------------------------- Performing changes to your installation The Bitnami HTTPS Configuration Tool will perform any necessary actions to your Bitnami installation. This may take some time, please be patient. ---------------------------------------------------------------------------- Success The Bitnami HTTPS Configuration Tool succeeded in modifying your installation. The configuration report is shown below. Backup files: * /opt/bitnami/apache/conf/httpd.conf.back.202405220509 * /opt/bitnami/apache/conf/bitnami/bitnami.conf.back.202405220509 * /opt/bitnami/apache/conf/bitnami/bitnami-ssl.conf.back.202405220509 * /opt/bitnami/apache/conf/vhosts/wordpress-https-vhost.conf.back.202405220509 * /opt/bitnami/apache/conf/vhosts/wordpress-vhost.conf.back.202405220509 Find more details in the log file: /tmp/bncert-202405220509.log If you find any issues, please check Bitnami Support forums at: https://github.com/bitnami/vms Press [Enter] to continue: That’s it. ...

May 22, 2024 · 2 min · 410 words · kenno

How to attach instance profile on EC2 with AWS CLI

This is a quick note to remind me on how to attach or associate an instance profile (IAM role) to an EC2 instance using AWS CLI. There is a bonus section at the end to show how to replace one IAM role with another one directly. In this example, I already have a running EC2 instance i-0357ecc1111111111 running. I want to attach a new instance profile called SSMInstanceProfile to this instance. But as we all know, only one instance profile can be associated with an EC2 instance at one time. So, let’s check to see if our instance already has one attached: ...

March 5, 2024 · 3 min · 436 words · kenno

Upgrading RHEL 8 to RHEL 9 on AWS

So I have an EC2 instance running RHEL 8.9 which was recently upgraded from RHEL 7.9. Now, I want to upgrade it all the way to RHEL 9. Here is the worklog which recording the steps I performed to achieve that goal. Step 0, perform a snapshot of the root volume of the instance, or create an AMI from it. In my case, this is just a test instance, so I skip taking the snapshot. ...

November 22, 2023 · 9 min · 1876 words · kenno

No support for RHEL with high availability in-place upgrade

Well, if you know you know, otherwise, you could have wasted the whole evening trying to upgrade RHEL 7.9 with High Availability to RHEL 8.x, and failed! If you read this post, head to the link at [1] and you’d see that Red Hat does not support i-place upgrades or rolling-upgrades of cluster nodes from one major release of RHEL to another. Here is an extract from [1]: Red Hat does not support in-place upgrades or rolling-upgrades of cluster nodes from one major release of RHEL to another. For example, there is no supported method for updating some nodes in a cluster from RHEL 6 to RHEL 7, introducing them into the cluster with existing RHEL 6 nodes to take over resources from them, and then updating the remaining RHEL 6 nodes. Upgrades in major releases of RHEL must be done by migrating services from a running cluster on the old release to another cluster running the new release. ...

November 15, 2023 · 2 min · 377 words · kenno

How to delete Lightsail resources using AWS CLI

In this post, I’ll document how to use AWS CLI to delete a few Lightsail resources. I have never done this before, so this would be a good exercise for me. To make it less boring, I’m writing this post while I’m deleting these resources. First step, I need to look for the instance name [1]. ❯ aws lightsail get-instances --query 'instances[].name' [ "WordPress-1" ] The above output is the name of the instance I’d like to delete. With its name, the instance can be deleted using the following command line [2]: ...

October 5, 2023 · 3 min · 464 words · kenno