Install apache in windows and configure ssl

Source: Internet
Author: User
Tags website server

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

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.