centos 7 secure site

The first step is to install the httpd service

yum -y install httpd

The second step is to create a directory ssl under /var/www/ and write the index.html file.

Insert image description here
The third step is to install the yum -y install mod_ssl module to set up a secure site.

Insert image description here
The fourth step is to create the private key file, create the request file, and create the certificate file.
cd below /etc/httpd/ssl

openssl genrsa -out s.key
 openssl req -new -key s.key -out s.csr
openssl x509 -req -in s.csr -signkey s.key -out s.crt

Insert image description here
The fifth step is to modify the configuration file /etc/httpd/conf.d/ssl.conf

/etc/httpd/conf.d/ssl.conf

Insert image description here
DocumentRoot “/var/www/ssl” website root directory
<VirtualHost 192.168.80.150:443> Change to local IP address

Insert image description here
SSLCertificateFile /etc/httpd/ssl/s.crt certificate file
SSLCertificateKeyFile /etc/httpd/ssl/s.key private key file
The SSLEngine on ssl engine has been started

The sixth step is to restart the httpd service.

systemctl restart httpd

You can access it in step seven.

Insert image description here
continue

Insert image description here
Nice

Guess you like

Origin blog.csdn.net/qq_51235445/article/details/125015013