Step 1: Configure APACHE to support SSL
Find the following two lines and remove the comment #
LoadModule ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf
Step 2: generate a certificate and private key file for the website Server
C: \ Program Files \ Apache Software Foundation \ Apache2.2 \ bin> openssl genrsa-out server. key 1024
Generate a server. key
Step 3: generate a signing application
C: \ Program Files \ Apache Software Foundation \ Apache2.2 \ bin> openssl req-new-out server. csr-key server. key-config .. \ conf \ openssl. cnf
The signing file SERVER. CSR is generated.
Step 4: Use OPENSSL to generate the CA private key
C: \ Program Files \ Apache Software Foundation \ Apache2.2 \ bin> openssl genrsa-out ca. key 1024
More CA. key Files
Step 5: Use the private key of the CA to generate the self-signed certificate of the CA
C: \ Program Files \ Apache Software Foundation \ Apache2.2 \ bin> openssl req-new-x509-days 365-key ca. key-out ca. crt-config .. \ conf \ openssl. cnf
Step 6: Create a New democadirectory under the bindirectory, and create index.txt, newcerts, and serial in democaas. The directory structure is as follows:
DemoCA
| --Index.txt (text, empty content)
| -- Newcerts (folder)
| -- Serial (text, content: 01)
Step 7: Prepare to sign a certificate for the website Server
C: \ Program Files \ Apache Software Foundation \ Apache2.2 \ bin> openssl ca-in server. csr-out server. crt-cert ca. crt-keyfile ca. key-config .. \ conf \ openssl. cnf
Generate the server. crt File
Step 8: Copy server. crt server. key to the conf folder
------------------ Ssl configuration FAQ ---------------------
During the configuration of 64-bit Windows 7 system, problems may occur when apache is restarted.
Problem 1: apache reboot failed, error message Syntax error on line 62 of C:/Program Files (x86)/Apache Software Foundation/Apache2.2/conf/extra/httpd-ssl.conf:
SSLSessionCache: Invalid argument: size has to be >=8192 bytes
Solution:
Change lines 61-63 in conf \ extra \ httpd-ssl.conf to the following to SSLSessionCache "dbm: C:/Program Files (x86)/Apache Software Foundation/Apache2.2/logs/ssl_scache"
# SSLSessionCache "shmcb: C:/Program Files (x86)/Apache Software Foundation/Apache2.2/logs/ssl_scache (512000 )"
SSLSessionCacheTimeout 300