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 install elasticsearch and kibana in docker

Elasticsearch is very popular now, and many compa...

Optimize MySQL with 3 simple tweaks

I don't expect to be an expert DBA, but when ...

Commonplace talk about the usage of MYSQL pattern matching REGEXP and like

like LIKE requires the entire data to match, whil...

How to open port 8080 on Alibaba Cloud ECS server

For security reasons, Alibaba Cloud Server ECS co...

The easiest way to install MySQL 5.7.20 using yum in CentOS 7

The default database of CentOS7 is mariadb, but m...

How to add fields to a large data table in MySQL

Preface I believe everyone is familiar with addin...

PHP-HTMLhtml important knowledge points notes (must read)

1. Use frameset, frame and iframe to realize mult...

How to query and update the same table in MySQL database at the same time

In ordinary projects, I often encounter this prob...

How to export and import .sql files under Linux command

This article describes how to export and import ....

How to reset the root password of Mysql in Windows if you forget it

My machine environment: Windows 2008 R2 MySQL 5.6...

Methods and steps for Etcd distributed deployment based on Docker

1. Environmental Preparation 1.1 Basic Environmen...

Basic principles for compiling a website homepage

1. The organizational structure of the hypertext d...

Example explanation of alarm function in Linux

Introduction to Linux alarm function Above code: ...

Solution to transparent font problem after turning on ClearType in IE

The solution to the transparent font problem after...