Dear my friend,
+ Who doesn’t want their website to have SSL Certificates, right? Therefore, in this tutorial, 1Byte will guide you to install the free SSL Certificate on your site
 

Here is your road map:

  • Step 1: Install PrestaShop framework, necessary packages, and set up customizations on the BackEnd side to the Server. You’ve done this in Part 1
  • Step 2: Based on the components in step 1, install PrestaShop site through your browser. You’ve done this in Part 2
  • Step 3: Install SSL Certificate on your website. You are here, Part 3!!!
  • Step 4: Customize the interface and manage PrestaShop to your liking ^^

PREREQUISITES

+ To be albe to finish Step 3, you need to read through and finished both Part 1 and Part 2 . This is a must and you have to have the following components:

1) Domain Name

2) Cloud Hosting or Cloud Server

3) PrestaShop framework is already installed both on your Server & browser

4) A spirit of eagerness to learn new things

let's do it

Step 1: Login into your Server via terminal

				
					ssh root@<your-server-IP>
				
			
Remember to change your IP Server

Step 2: Configure firewall-cmd to accept https service

				
					sudo firewall-cmd --zone=public --permanent --add-service=https
sudo firewall-cmd --reload
sudo firewall-cmd --list-services
				
			
Successfully added https service
Step 3: Insteal the Certbot Let’s Encrypt
				
					sudo yum install epel-release -y
sudo yum install certbot python2-certbot-apache mod_ssl -y



				
			
Step 4: Point your domain into this Cloud Server/ Cloud Hosting
 
NOTE:
+ You need to have a domain name. This is a MUST. If you don’t have a domain name, you can’t continue this tutorial 😂. We would really appreciate if you purchased on 1Byte’s Website
+ Do you know what your server’s IP address is? This is also a must, and there are several methods to figure out:
  • Method 1: You can check your email to get this information
  • Method 2: You can go to User Dashboard, choose the Cloud Server or Cloud Hosting section, and get its IP
  • Method 3: Check directly on the terminal with ifconfig command

END OF NOTTING:

+ Ok, back to the main point. At here, I will guide you to point your domain to Cloud Server/Cloud Hosting on 1Byte platform 
+ If you use a 3rd party domain, you have to do it yourself because each provider will have a different way of pointing, and managing domains
1Byte encourages you to buy our domains. Why? Because following to the instructions step-by-step guarantees success 100%. 

4.1 – Login into your User Dashboard, navigate to Domain section and choose the domain that you want to use

Here, 1Byte will use domain hobbykh.fun to do the demo

 4.2 – Navigate to DNS Management and do as shown below

Here the IP address of Cloud Hosting/Cloud Server is 112.109.90.106. Please replace your IP address instead. And finally, don’t forget to click Save
NOTE:
+ If your domain is completely new
→ This process only takes 5-15 minutes
 
+ If your previous domain has been used, and now you transfer this domain to a new host
→ This process may take up to 30 minutes. Depends on what was the previous TTL value you used
END OF NOTTING

4.3 – Verify wheter your domain has received the server’s IP address or not?

				
					#Using ping command to verify
ping hobbykh.fun -c4



				
			
As you can see, the domain hobbykh.fun has pointed to the IP address 112.109.90.106
Step 5: Generate the cert key & install Let’s Encrypt SSL Certificate

+ Back to your terminal, and type the command followings:

				
					#Remember to change your domain name in here
sudo certbot --apache -d hobbykh.fun -d www.hobbykh.fun

				
			

+ The program will present you with a step-by-step guide to customize your certificate options. It will ask you to provide an email address for lost key recovery and notices, and then prompt you to agree to the terms of service.

+ If you did not specify your domains on the command line, you will be prompted for that as well.

+ If your Virtual Host, which we already done in Part 1 files do not specify the domain they serve explicitly using the ServerName directive, you will be asked to choose the virtual host file. In most cases, the default ssl.conf file will work.

+ You will also be able to choose between enabling both http and https access or forcing all requests to redirect to https. For better security, it is recommended to choose the option 2: Redirect if you do not have any special need to allow unencrypted connections. Select your choice then hit ENTER.

				
					Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel):2
				
			
(This is the case that your domain has not been used before)

NOTE:

+In the special case, your domain has been used for a certain website, and has installed SSL certificates. Then Output from terminal will look like this

(Because this domain hobbykh.fun has been used before, so I will choose option 1)

 


(If you receive a message like the image above, this means you have already installed an SSL Certificate on your website)

Step 6: Navigate to your website and check again

(Ouch…our website has not secured yet @@! What’s wrong???)
 
EXPLAINATION:
+ Let’s Encrypt, my dear friend, has already installed the SSL certificate on our website successfully.
If you recall from Part 2, we told PrestaShop not to force to use the SSL certificate in haste since we want to connect to PrestaShop insecurely (http) first, then install the SSL certificate afterwards.
+ Now we just need to go back to the Admin Dashboard, and configure PrestaShop to use SSL certificate

Step 7: Configure PrestaShop to only use https (secured protocol)


(You still remember the way to connect to Admin Dashboard right? In my case, I will head to “secret_page”, use my credential to login)

 

After Log in to PrestaShop as the administrator, On the left-sidebar menu, in the Configure section, select General option 

As you can see, PrestaShop has not yet enabled SSL, which is why Let’s Encrypt installed successfully, but when we access the website, the browser reports an Insecure Connection
Currently PrestaShop has not enabled SSL, so when you click on the above link, your browser will warn you. Just click Advanced… then Accept The Risk