Server Configuration
This page will guide you with installing the generated certificates from cloudflare on your server.
Please follow each step in order.
Prerequisites
- You have saved the
origin.pemand theorigin.keyfrom the cloudflare configuration. -
Important!
If you did not save both generated codes for the SSL certificate, please head back to Configure Cloudflare .
Login as root
After you have setup all the A-records records in cloudflare, login into your server / VPS.
You can add any desired SSH client, like Termius, Putty or anything else to do so.
If you dont have your root password yet, you probably received a one time root password in your email, when you have purchased your server or VPS.
Make sure to enter the right connection credentials in your SSH client.
When succesfully connected run the following command:
sudo passwd root
It will ask you to enter a new password, make sure to remember it.
After, it will ask you to confirm your entered password by typing it again.
You can enter as root user, by typing su root.
Then enter your set password and press enter.
Create files for the SSL certificate
The nano editor is a sort of text editor, so you can edit files on your server with a command.
Please note:
For pasting text, please use CTRL + SHIFT + V
For copying text, please use CTRL + SHIFT + C
Explanation for the commands you are going to run:
The /etc/ folder is there by default when the server was installed.
This folder is meant to host system wide files, so important files can be accessed easily.
Then, the first command will create 2 folders called /ssl/ and /cf inside the /etc/ folder.
Right after, the nano command will creates a new file called whatever you name it and lets you edit it.
In our case, a file called origin.pem will be created and opened in an editor.
When you have succesfully logged in on your server, we will start with making a folder to put the files in.
Creating a folder for the files:
To create a folder, run the following command:
mkdir /etc/ssl/cfCreating a file for the certificate:
After that, we will create a file for certificate itself, we will call it
origin.pem.We can do that by running a command:
sudo nano /etc/ssl/cf/origin.pem
Then, paste your generated certificate from CloudFlare by pressing CTRL + SHIFT + V.
After, press CTRL + X. It will ask you to save the file. Press y and press enter.
Creating a file for the private key:
Now, we will do the same thing, for the generated private key from CloudFlare. Run the command:
sudo nano /etc/ssl/cf/origin.key
Make sure to copy your private key from CloudFlare, and paste it again using CTRL + SHIFT + V.
Then, save the file again with CTRL + X. Press y and hit enter.