Install SSL on VPS Nginx – SSL is one of the important parts of a website. SSL will serve as protection against everything that will enter and lead to the website. Maybe the beginners are still confused and doubt whether it is important to install SSL on the website. By installing SSL, you can avoid attacks that will enter the website. This time we will explain the tutorial on Install SSL on VPS which can be done easily. Following are the guidelines for Install SSL on VPS in full :
How to Install SSL on VPS Nginx, Easy Tutorial You Must Try!
Before installing SSL, there are several stages of preparation that you must do:
1. First, make sure you have ordered SSL first.
2. Prepare a CRT file (certificate), Private Key, Cabundle SSL. The three files were obtained when you paid off the SSL purchase invoice.
3. Next, make sure you can remote VPS via SSH. And also make sure you already have a VPS first.
4. Know some of the commonly used Linux commands / commands. If not, please read and search for references first. If you have passed the four stages, please go to the steps below.
How to Install SSL on VPS Nginx Version
The way to install SSL at Nginx is very easy. Please follow the step by step below. Make sure the nginx web server is installed on your VPS first. If not, please install it first!
1. Activate SSL at Nginx
To enable SSL at Nginx please write :
nginx service starts
2. Creating an SSL Folder
• Now it’s time to create an SSL folder containing the .crt, .key and .cabundle files. Please enter the / etc / apache2 folder by the method :
cd / etc / nginx /
• Then create a folder called “ssl” by the way :
• After that, go to the ssl folder and please create a .crt, .key and .ca-bundle file using the touch command :
touch [FILE NAME] .crt
touch [NAME FILE] .key
touch [FILE NAME] .ca-bundle
Remember! You have to make 3 files! So that later 3 files will appear as shown below. For free file names, please write as desired.
• For simplicity, you can unite the three files with the .pem extension. The way is :
Cat [FILE NAME] .crt [NAME FILE] .key [NAME FILE] .ca-bundle> [FILE NAME].
3. Copying .crt, .key and .ca-bundle files
• Prepare the .crt, .key and .ca-bund files immediately from your SSL. Then copy the three files one by one into the file. The method is please write :
nano [NAME FILE]
• Then copy all three files (.crt file, .key file, .ca-bundle file) into [NAME FILE]. One by one.
* Note: If using nano, then right-click paste. Then save by pressing ctrl + x then press “Y” and enter.
4. Installing SSL
• The .crt, .key and .ca-bundle files have been prepared. Now it’s time for you to direct Nginx to all three files. The way is :
cd / etc / nginx / sites-enabled /
• Then search for the default file. Later, you must edit the configuration in the file. To edit the configuration, please write :
* Note: You can use various editors like nano or vim.
5. Restart the Nginx Service
• After all configurations have been entered in the default file, it is time to restart the nginx service. Please write :
nginx service restarts
• After that in the ssl_certificate section and ssl_certificate_key is filled with the path (location) of each file :
ssl_certificate / etc / nginx / ssl / [NAME FILE] .em;
ssl_certificate_key / etc / nginx / ssl / [NAME FILE] .em;
• Don’t forget to remove the # (fence) before ssl_certificate and ssl_certificate_key!
Then make sure you have activated listen 443 ssl. The method is to remove the fence before the word listen 443 ssl;
6. Checking SSL
• Now it’s time, you check whether SSL has been successfully installed or not. The command is :
openssl s_client -connect [NAME DOMAIN]: 443
• Details will appear as below. Make sure that there is an SSL provider name listed there. For example, the SSL used is Comodo PositiveSSL. Then provide “COMODO” writing in it will appear.
• Now how to install SSL on VPS with the Nginx web server complete.
For a tutorial on how to install SSL on the Apache Version VPS, you can check on the side. How now, you can easily install SSL on VPS Nginx itself ? Actually the SSL install process on Nginx and Apache is the same. You only need to direct all three important SSL files such as public key, cabundle and also the certificate into the web server configuration. Hopefully all the information above can help you who will Install SSL on VPS Nginx and hope this information can be useful. Good luck!