The realization of hppts

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.