I. Installing the SSL module
Yum-y Install Mod_ssl (RPM-based package installation httpd requires manual installation of this module)
Two. Self-built CA
Cd/etc/pki/ca
(Umask 077; OpenSSL genrsa-out PRIVATE/CAKEY.PEM 2048)//Generate private key
Vim.. /tls/openssl.cnf
Find req_distinguished_name option to modify default values
Generate self-signed certificates
OpenSSL req-new-x509-key private/cakey.pem-out cacert.pem-days 3655
To modify the DIR option for a configuration file Ca_default
Vim.. /tls/openssl.cnf
DIR =/etc/pki/ca
Create directories and files under the CA directory
mkdir certs CRL Newcerts
Touch Index.txt
echo > Serial
Three. Providing SSL services for Web servers
1. Create an SSL directory under the/etc/httpd/directory
mkdir SSL
CD SSL
2. Generate key
(Umask 077; OpenSSL genrsa 1024x768 > Httpd.key)
3. Generate a certificate issuance request
OpenSSL Req-new-key httpd.key-out HTTPD.CSR
4. Certificate generation complete send certificate to client
SCP HTTPD.CSR 192.168.1.79:/tmp
5. Signing the certificate on the client
OpenSSL ca-in/tmp/httpd.csr-out/tmp/httpd.crt-days 3655
6. Check the/etc/pki/ca/index.txt file validation on the server side for successful signing
Cat serial
7. Copy the signed certificate to the client
SCP 192.168.1.79:/TMP/HTTPD.CRT./
8. Modify the/etc/httpd/ssl/ssl.conf file on the server
<virtualhost 192.168.1.79:443>
DocumentRoot "/www/luochen"
ServerName www.luochen.com
Sslcertificatefile/etc/httpd/ssl/httpd.crt
Sslcertificatekeyfile/etc/httpd/ssl/httpd.key
</VirtualHost>
This article is from "Luo Chen's blog" blog, please be sure to keep this source http://luochen2015.blog.51cto.com/9772274/1685846
The realization of hppts