Redirect HTTP traffic to HTTPS with .htaccess

Now that I have made the switch to SSL, I needed to make sure that any traffic that hits the website uses SSL.

A quick and easy way to do this is to use the .htaccess file and add the following into it:

Make sure that the following two lines are right below the RewriteEngine line:

Setting up SSL using CPanel and Let’s Encrypt

I have been meaning to update this site to use SSL for a while now.

Why SSL? – Quick answer: Security and Encryption. Any web traffic to an SSL enabled site ensures that the traffic is encrypted and information is transmitted securely.

Anyway, here is a quick guide to enabling SSL using a certificate generated from Let’s Encrypt.

Step 1:

Login to CPanel and head over to the SSL / TLS section.


Step 2:

If you do not already have one, create a Private Key. Make sure you keep this secure.

  • Key Size: 2048 bits

A private key is used to decrypt information transmitted over SSL. When you create an SSL certificate, the first step is to generate a private key file associated with that SSL certificate. You should generate a private key for each SSL certificate you create. This private key is very important and should be kept confidential. A copy of each private key should be kept in a safe place; there is no way to recover a lost private key.

Step 3:

One the Private Key has been generated, create a Certificate Signing Request (CSR). This is what is used to request a Certificate from a Trusted Certificate Authority.

If you obtain a certificate from a trusted SSL provider, you must complete the Certificate Signing Request form to provide the information needed to generate your SSL certificate.

Step 4:

Head over to and use the Free SSL Certification Wizard. This simplifies the process of requesting a free SSL certificate from Let’s Encrypt.

Include the following information:

  • Email address for certificate expiration reminders.
  • If using Let’s Encrypt for the first time, leave the section for the ‘Let’s Encrypt’ key blank. One will be generated for you.
  • Finally paste the CSR created in Step 3 in the CSR section and proceed.
  • Note: Let’s Encrypt certificates are only valid for 90 days.
  • Also, keep a copy of the generated ‘Let’s Encrypt’ key that has been generated. This will be required when renewing the certificate.

Step 5:

Once a request has been made, it will need to be verified. This is done so Let’s Encrypt can ensure that the certificate being generated for the domain is under your control. This helps prevent MitM attacks. You don’t want anyone coming and generating certificates for your domain.

Verification is made by creating a file with some text at the root of your domain or by editing DNS entries. It depends on whichever method you prefer.

The “Verification” screen

This screen does not require you to enter anything. It shows what needs to be done to prove your domain ownership. If you are using HTTP verification, then for each domain on your certificate you will be given a name and the content of the file to be created. Each name is also a link, so after you have created a file, you can click that link to make sure that the file is actually accessible and the content of it is what it should be. If you are using DNS verification, then you will be given a name for the DNS TXT record and its value. It will also show you how to check that your DNS changes became “visible”.

After creating a file or making DNS changes (and making sure those are visible) you can click “Next”. If everything is done right, you will be moved to the final screen (“Certificate”). If any error happens, then you will see verification results for those domains which have failed verification. After reading the results, click “Next” for the “Verification” screen to be displayed again with the new values for the domains which have failed. There will be no need to re-do those domains on your list which have succeeeded [sic] verification.

Step 6:

Once successfully verified, a free SSL certificate is generated. Copy the CSR key and head back to CPanel and upload it into the Certificates (CRT) Section. If everything has gone smoothly, it will be uploaded without any issues. Check the ‘decoded’ section to ensure everything looks correct.

Step 7:

Finally, we are ready to apply the SSL certificate. Head on over to the, ‘Install and Manage SSL for your site (HTTPS)’ section and under the ‘Install an SSL Website’ click the ‘Browse Certificates’ button. A pop up window will display the uploaded certificate. Select this.

Step 8:

This will automatically match the domain and certificate info. Save changes are you are ready to go!


  1. – Let’s Encrypt
  2. – ZeroSSL
  3. РCPanel  SSL/TLS section documentation
  4. – What is SSL?

Increasing the size of a Virtual Disk in Oracle VM VirtualBox

Right, so using Oracle VM Virtual Box, you have a virtual disk that is fast running out of space and it needs to be expanded.

Unfortunately, within the VirtualBox GUI, there is no option to allocate more storage space to the virtual drive. So, how can more space be allocated to it?


Open a command prompt and navigate to your Oracle Virtual Box installation location. Mine is at:

Within the installation folder there is a cool tool called VBoxManage.exe that offers a command line interface or CLI to manage Virtual Box. More info here: VBoxManage Documentation

If the virtual machine is still running, shut it down before carrying out the next step or else the command will fail as the virtual disk will be in use and no modifications can be made to it.

Anyway, to expand the virtual disk, use the following command:

For example, my test virtual hard disk is located on another partition so to increase its capacity from 8GB to 10GB I issued the following command:

As there are spaces within the file path, I encapsulated them in quotes.

Pretty neat and simple:

Screenshot of result

Now I have a 10GB virtual hard disk. You might need to close and open VirtualBox for it to pick up the increased storage space and if using Windows, run Disk Manager and allocate the additional storage.


Well, my first ever entry on here.

I have been meaning to start blogging for a really long time but kept putting it off.

After loads of blood, sweat and tears (a bit of an exaggeration there), I have finally managed to get this up and running. Been a while since I set one of these up but I think I have managed to get it all set up and put my mark on it.

So what do I do?

I work in IT! Yeay! I absolutely enjoying working in IT and everyday is a different day.

Well, everyday IS a different day and sometimes they can be crazy crazy days.

I look after the end users and make sure they are all happy and everything is working smoothly! (If only).

Anyway, a very short introduction from me. Let’s see how this goes. (Famous last words there).