Detailed explanation of how to enable https service in Apache under Linux environment

Detailed explanation of how to enable https service in Apache under Linux environment

This article describes how to enable https service in Apache under Linux environment. Share with you for your reference, the details are as follows:

First, apply for an SSL certificate. Taking Alibaba Cloud as an example, find the domain name management:

Free SSL certificate:

Configure a single domain name free certificate: (valid for one year)

Click OK to verify the certificate:

After successful review, you can download the certificate:

Download the SSL certificate for Apache:

I unzipped these three and put them in the Apache installation directory /etc/httpd/cert

Add this to httpd.conf (import all conf files under the conf.d folder):

Include conf.d/*.conf

Run these two:

yum install mod_ssl
yum install openssl openssl-devel

Find this file /etc/httpd/conf.d/ssl.conf :

Replace all contents:

<VirtualHost *:443>
  DocumentRoot "/var/www/html"
  ServerName www.msllws.top
  SSLEngine on
  SSLCertificateFile /etc/httpd/cert/932538_www.msllws.top_public.crt
  SSLCertificateKeyFile /etc/httpd/cert/932538_www.msllws.top.key
  SSLCertificateChainFile /etc/httpd/cert/932538_www.msllws.top_chain.crt
</VirtualHost>

 
NameVirtualHost *:443

Then you can access https

I hope this article will help you configure your Linux server.

You may also be interested in:
  • Apache https configuration detailed steps
  • Introduction to Apache deployment of https in cryptography

<<:  How to use axios request in Vue project

>>:  Detailed explanation of the idea of ​​installing mysql8.0.11 and changing the root password and connecting navicat for mysql

Recommend

Detailed explanation of the data responsiveness principle of Vue

This article is mainly for those who do not under...

A brief analysis of the use of watchEffect in Vue3

Preface Everyone should be familiar with the watc...

10 SQL statement optimization techniques to improve MYSQL query efficiency

The execution efficiency of MySQL database has a ...

Pure CSS to add style to select (no script) implementation

Change the default style of select, usually throug...

How to add Vite support to old Vue projects

1. Introduction I have taken over a project of th...

Detailed explanation of JavaScript's built-in objects Math and strings

Table of contents Math Objects Common properties ...

Markup Language - List

Standardized design solutions - markup languages ...

Mysql database scheduled backup script sharing

BackUpMysql.sh script #!/bin/bash PATH=/bin:/sbin...

Encoding problems and solutions when mysql associates two tables

When Mysql associates two tables, an error messag...

Do you know how to use mock in vue project?

Table of contents first step: The second step is ...

How to count the number of specific characters in a file in Linux

Counting the number of a string in a file is actu...

How to output Chinese characters in Linux kernel

You can easily input Chinese and get Chinese outp...

VScode Remote SSH remote editing and debugging code

The latest Insider version of Visual Studio Code ...

WeChat applet realizes the nine-square grid effect

This article shares the specific code for the WeC...