Install Apache and configure SSL under Windows

Source: Internet
Author: User
Tags config openssl

Step 1: Configure Apache to support SSL

Find the following two lines to remove the previous comment #

LoadModule Ssl_module modules/mod_ssl.so

Include conf/extra/httpd-ssl.conf

Step 2: Generate the certificate and private key file for the Web server

C:Program filesapache Software foundationapache2.2bin>openssl genrsa-out server.key 1024

Generate a Server.key

Step 3: Generate the signing request

C:Program filesapache Software foundationapache2.2bin>openssl req-new-out server.csr-key ... Confopenssl.cnf

The signature file SERVER is generated at this time. DS5

Step 4: Use OpenSSL to generate the CA private key

C:Program filesapache Software foundationapache2.2bin>openssl genrsa-out ca.key 1024

More Ca.key files

Step 5: Use the CA's private key to generate a self-signed certificate for the CA

C:Program filesapache Software foundationapache2.2bin>openssl req-new-x509-days 365-key ca.key-out ca.crt-config .. Confopenssl.cnf

Step 6: Create a new Democa directory under the Bin directory, and under Democa, create a new index.txt,newcerts,serial directory structure as follows

Democa

|--index.txt (text, empty content)

|--newcerts (folder)

|--serial (text, Content 01)

Step 7: Prepare to sign the certificate for the Web server

C:Program filesapache Software foundationapache2.2bin>openssl ca-in server.csr-out server.crt-cert ca.crt-keyfile C A.key-config.. Confopenssl.cnf

Generating SERVER.CRT files

Step 8: Copy the SERVER.CRT Server.key to the Conf folder

------------------Configure SSL FAQ---------------------

Win7 System 64 bits in the configuration process, there may be a problem restarting Apache

Problem 1:apache reboot failed, error message syntax error on line 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 the 61-63 lines in confextrahttpd-ssl.conf to the following Sslsessioncache "Dbm:c:/program Files (x86)/apache Software Apache2.2/logs/ssl_scache "

# Sslsessioncache "Shmcb:c:/program Files (x86)/apache Software Foundation/apache2.2/logs/ssl_scache (512000)"

Sslsessioncachetimeout 300

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.