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:
|
<<: Differences between this keyword in NodeJS and browsers
>>: Steps for using the non-installed version of MySQL and solutions for forgetting the password
Elasticsearch is very popular now, and many compa...
I don't expect to be an expert DBA, but when ...
like LIKE requires the entire data to match, whil...
For security reasons, Alibaba Cloud Server ECS co...
The default database of CentOS7 is mariadb, but m...
1. Download MySQL from the official website: This...
Preface I believe everyone is familiar with addin...
1. Use frameset, frame and iframe to realize mult...
In ordinary projects, I often encounter this prob...
This article describes how to export and import ....
My machine environment: Windows 2008 R2 MySQL 5.6...
1. Environmental Preparation 1.1 Basic Environmen...
1. The organizational structure of the hypertext d...
Introduction to Linux alarm function Above code: ...
The solution to the transparent font problem after...