Apache Configuration SSL secure connection under Windows

Source: Internet
Author: User
Tags openssl website server

What is SSL?

SSL (Secure Socket Layer): is a secure protocol for HTTP transmissions that ensures that data between the client and the Web server is secure through certificate authentication. Open SSL Download Address: http://www.openssl.org/source/

First, download and install Apache that supports SSL

1. Install Apache with SSL module,

Download Address Http://httpd.apache.org/download.cgi#apache23

Annex provides Httpd-2.2.15-win32-x86-openssl-0.9.8m-r2.msi

2. Configuration: Open the Apache configuration file conf/httpd.conf

LoadModule Ssl_module modules/mod_ssl.so

Include conf/extra/httpd-ssl.conf

Remove the # in front of two lines, and customize the configuration file. conf can also be included in by include.

Modify the two fields in the httpd-ssl.conf (or custom *-ssl.conf) file:

Sslcertificatefile "D:/APACHE2.2/CONF/SERVER.CRT"

Sslcertificatekeyfile "D:/apache2.2/conf/server.key"

Generate certificate and private key file for Web server

1. Generate an RSA private key for the server Apache

OpenSSL genrsa-out Server.key 1024

Generated a 1024-byte file Server.key, generating certificate signing request CSR

2. Generate Signed Application

OpenSSL req-new–out Server.csr-key server.key-config. Confopenssl.cnf

which

Country Name: Two-letter country code

State or province name: province name

Locality name: City names

Organization Name: Company names

Organizational Unit name: Department names

Common Name: Your name

Email Address: addresses

The signature file SERVER.CSR is generated at this time.

Third, through the CA for the website server signing certificate

1.Generating RSA private key for CA (1024 bit) [Ca.key]

Generate CA private key

OpenSSL genrsa-out Ca.key 1024

More Ca.key files

2.Generating X.509 certificate signing request for CA [CA.CSR]

To generate a self-signed certificate for a CA using the CA's private key

OpenSSL req-new-x509-days 365-key ca.key-out ca.crt-config. Confopenssl.cnf

3.CA signing certificate for Web server

Create the Democa in the Bin directory, where the following files are created, index.txt,serial:serial content is 01, the other is empty, and the folder Newcert. To do it again, you can generate SERVER.CRT files

OpenSSL ca-in server.csr-out server.crt-cert ca.crt-keyfile ca.key-config. Confopenssl.cnf

Four, then copy the Server.crt,server.key to Apache folder, restart Apache.

Related Article

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.