Simple implementation of HTTPS and automatic implementation of ssl

coldplay.xixi
Release: 2023-04-09 14:54:02
forward
2571 people have browsed it

Simple implementation of HTTPS and automatic implementation of ssl

It is well known that the HTTP protocol is an insecure protocol, and the HTTPS protocol is the abbreviation of HTTP over SSL/TLS, which means "HTTP using SSL/TLS, which is usually The so-called "Hypertext Transfer Security Protocol". HTTP combined with SSL/TLS protocol can build a network protocol for encrypted transmission and identity authentication.

The webpage before upgrading to HTTPS is as follows

Configure HTTPS

The default port of HTTPS is 443, permanently add this port number to the firewall whitelist.

sudo firewall-cmd --zone=public --add-port=443/tcp --permanent
sudo firewall-cmd --reload
Copy after login

View open ports

sudo firewall-cmd --list-port80/tcp 443/tcp
Copy after login

Install the SSL module

sudo yum -y install mod_ssl
Copy after login

After the installation is completed, generate the ssl configuration file in the Apache configuration directory

/etc/httpd/conf.d/ssl.conf
Copy after login

The corresponding private key can be seen from the above figure and the certificate is placed in

/etc/pki/tls/private/localhost.key/etc/pki/tls/certs/localhost.crt
Copy after login

Restart the Apache service

sudo systemctl restart httpd
Copy after login

Visit in the browser https://lamp.test.com

Click on the red warning sign and find that the certificate is only valid for one year.

Since then, HTTPS has been implemented by automatically installing the ssl module.

Want to know more For programming learning, please pay attention to the php training column!

The above is the detailed content of Simple implementation of HTTPS and automatic implementation of ssl. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:juejin.im
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template