How to deploy HTTPS for free on Tencent Cloud

How to deploy HTTPS for free on Tencent Cloud

Recently, when I was writing a WeChat applet, the WeChat applet required all request interfaces to be deployed on the https protocol, so I studied how to deploy an https environment on Tencent Cloud and found that it was relatively simple. First of all, my server environment is Ubuntu 16.04, LAMP environment.

Get an SSL Certificate

In Tencent Cloud's SSL certificate service, the domain name (DV) SSL certificate is free, so we are mainly applying for this certificate this time. If you need other types of certificates, please also pay for the application.

Enter the SSL certificate management console and click Apply for a certificate

You can see the application form as shown below:

After filling in the application information, wait about an hour for the certificate to be issued. Then configure the applied secondary domain name in Cloud Resolution:

After resolving the secondary domain name, wait for the certificate application to be completed.

After the certificate application is approved, download the certificate.

Upload SSL Certificate

Unzip the downloaded certificate and you will see certificates for Apache, IIS, Nginx, Tomcat, etc. Select the corresponding certificate according to your server environment. Here, based on the Apache environment I am using, I use FileZilla to upload the certificate file to the Apache directory. The path I uploaded is /etc/apache2/ctr, where ctr is the folder I created to store the certificate.

Add HTTPS to Apache Configuration

After the certificate is uploaded, I create a file called vhostssl.conf in the path /etc/apache2/sites-available and write the https configuration information of my site in this file.

Listen 443
<VirtualHost *:443>
  ServerName www.example.com:443
  DocumentRoot "/var/www/html/example"
  ServerAlias ​​www.example.com
  SSLEngine on
  SSLCertificateFile "/etc/apache2/ctr/examplecom/Apache/2_example.com.crt"
  SSLCertificateKeyFile "/etc/apache2/ctr/examplecom/Apache/3_example.com.key"
  SSLCertificateChainFile "/etc/apache2/ctr/examplecom/Apache/1_root_bundle.crt"
</VirtualHost>

Write the above configuration information into the vhostssl.conf file. Note that you should replace example with your own domain name and modify it to the correct certificate path.

After the configuration file is completed, go to the /etc/apache2/sites-enabled/ path,

ln -s ../sites-available/vhostssl.conf

Execute this command to add a soft link to the sites-available directory.

After all these tasks are completed, execute

$ service apache2 restart

Restart the Apache server, then enter https in front of the domain name you configured, and you will see a small green lock. The https configuration is now complete.

After completing the configuration, you will find it very simple, right?

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Detailed steps to deploy https on Alibaba Cloud using nginx + node

<<:  Differences between this keyword in NodeJS and browsers

>>:  Steps for using the non-installed version of MySQL and solutions for forgetting the password

Recommend

How to view the creation time of files in Linux

1. Introduction Whether the creation time of a fi...

How to change the password of mysql5.7.20 under linux CentOS 7.4

After MySQL was upgraded to version 5.7, its secu...

JavaScript tips to help you improve your coding skills

Table of contents 1. Filter unique values 2. Shor...

Simple implementation method of Linux process monitoring and automatic restart

Purpose: Under Linux, the server program may be d...

HTML+CSS to achieve responsive card hover effect

Table of contents accomplish: Summarize: Not much...

MySQL data migration using MySQLdump command

The advantages of this solution are simplicity an...

Detailed explanation of angular two-way binding

Table of contents Bidirectional binding principle...

Introduction to general_log log knowledge points in MySQL

The following operation demonstrations are all ba...

MySQL transaction isolation level details

serializable serialization (no problem) Transacti...

Vue imports Echarts to realize line scatter chart

This article shares the specific code of Vue impo...

Tutorial diagram of installing mysql8.0.18 under linux (Centos7)

1 Get the installation resource package mysql-8.0...