1. Log in to your server via SSH

2. Create the directory where you want to place SSL certificate files

mkdir SSL

2. Navigate to a chosen directory where you want your certificate to be placed

cd SSL

3. Generate a certificate signing request and a key file:

openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain.key -out yourdomain.csr

NOTE that openssl package is used. If it had not been installed, you would have to install it first. See a separate post on that subject.

Follow the prompts and insert the necessary info.

4. Open the .csr file in a reader, and copy its content:

less yourdomain.csr

It should look like this:

—–BEGIN CERTIFICATE REQUEST—–
MIIC3zCCAccCAQAwgYMxCzAJBgNVBAYTAlVTMREwDwYDVQQIDAhOZXcgWW9yazER
MA8GA1UEBwwITmV3IFlvcmsxDjAMBgNVBAoMBVVVQ1NSMQswCQYDVQQLDAJJVDEW
MBQGA1UEAwwNd3d3LnV1Y3NyLm9yZzEZMBcGCSqGSIb3DQEJARYKZHZAdndtLmNv
bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANXyg1wtkXNCbQu6Iqpz
5Z0F6puW0etsZAd4RZyEiZeoSpRC6sAx2dbecir0kgpKVD1q0rxDmAMaYBLB3sfB
V94BnYNUtz9e957oGqJJdb1T5cXcBWOzTgezYa5tgbvSSkhc9McUrXjpKJ9qFgbW
BwtzCR/V13kEI+SKAxCmLwbHh/RUBuopq8UyO1HxIySSxiZVkNgIb19D66zJdsmm
4LsxNLI/l4nL6zXqsTuGFjPZ1ZLY/nMCpEDyM+lYFFpL58BN26CJ1TcXnQTPrY5d
3W8xCJEiOPXt+KG2CsKNEDEIBmiTdJdzzDU+YCmc1yWwfc4tdpxm6Ss5aO3gWWXV
dIkCAwEAAaAWMBQGCSqGSIb3DQEJAjEHDAVVVUNTUjANBgkqhkiG9w0BAQUFAAOC
AQEABD6zK5hG7VVHR3ICe71iv1IXjurPPYZ9yz5iYpHV+FweNxW7CIRxdh5W5yg3
eKIBCQVjRzKWnvjsEuWWV4nEr4P61Fk+6pBtRGRuZTqjwdvpyaWV+OSO3o7ImWpO
jNUujjRHH5rUiFyYmzmX7KNgJWbZDVT2aXyPDd0x453wJA7VtLiEOZRmMDYU2Nbk
WdwcZ1te8oCKS5TxLOKQzKPQWwXBsdESYPC/BxGx6UpgLX2HgrBzERqd/wQTwBfH
3NFYEVREAG1g+8KMdGUzlCbopKB88RRdAK/caHOQnsU73SjPjRukyoSah0Ovtc65
N7vueQhbBeEqD6RGQ7L1I5fiZA==
—–END CERTIFICATE REQUEST—–

5. Paste this string into the appropriate area in the certificate issuing authority website (for example, in GoDaddy’s SSL area) and generate the SSL certificate.

6.