How to simply install Let’s Encrypt certificate on VPS using HocVPS

Tutorials 0 lượt xem
This post is part 2 of 3 in the Using HocVPS . series

HocVPS does not integrate the Let’s Encrypt certificate installation feature. So you install it manually like this guide on hocvps .

But that tutorial is quite complicated.

In this article, I will show you how to install Let’s Encrypt SSL certificate using Certbot. It is simple and suitable for those who are new to VPS.

Let’s start together.

Install Certbot

First you install Certbot using the following commands:

Install Let’s Encrypt SSL certificate using Cerbot

You use the following command to install the certificate:

You need to enter your email address and answer a few questions as follows:

install lets Encrypt certificate for vps using hocvps 1 install lets Encrypt certificate for vps using hocvps 2

Automatic Let’s Encrypt certificate renewal

Enable HTTP/2

The Certbot configuration added to nginx does not support HTTP/2. Open the configuration file:

Then add http2 to the 2 paragraphs with

install lets Encrypt certificate for vps using hocvps 5

At the same time you convert http to https in the rewrite line:

install lets Encrypt certificate for vps using hocvps 13

Enable HTTP/2 for NGINX and optimize HTTPS

Nginx is having problems with HTTP2. You can see more in this article.

HocVPS has a post to enable HTTP2. You see here.

But I like to install Nginx compiler from Vultr .

I will show you how to do this.

Install Developer Tools:

Download and install dependent Nginx libraries

Download and extract the latest Nginx mainline version:

Load libraries that will compile with Nginx

Remove .tar.gz files

Go to Nginx source code directory:

Copy the Nginx manual page to  /usr/share/man/man8 :

Compile and install Nginx:

Restart Nginx:

Check Nginx version again

An OpenSSL version like this is OK:

install lets Encrypt certificate for vps using hocvps 8

Check again you will see that the Http/2 protocol is enabled:

install lets Encrypt certificate for vps using hocvps 9

Optimizing Https to test SSL Lab Test is A+ as below:

install lets Encrypt certificate for vps using hocvps 10

How to optimize you see this article .

You just need to configure Nginx to support HSTS (point 6 in the article) is enough.

Add the following line to the Nginx configuration file and restart Nginx:

install lets Encrypt certificate for vps using hocvps 12

It’s done.

With the above simple way, installing the Let’s Encrypt certificate no longer has to be manually configured like in hocvps.

View articles in the series

Previous Part: Instructions for installing WordPress on CentOS 6/7 with HocVPS script Next part: Instructions for installing Memcached on CentOS 7 with HocVPS

Bài viết liên quan